services: Clarify extend/compose of BOOT-SERVICE-TYPE.
* gnu/services.scm (compute-boot-script): Add first placeholder parameter. (boot-service-type): Change 'compose' to APPEND, and 'extend' to COMPUTE-BOOT-SCRIPT.
This commit is contained in:
parent
5adbe65fec
commit
3a391e68da
|
@ -182,7 +182,7 @@ This is a shorthand for (map (lambda (svc) ...) %base-services)."
|
||||||
;;; Core services.
|
;;; Core services.
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define (compute-boot-script mexps)
|
(define (compute-boot-script _ mexps)
|
||||||
(mlet %store-monad ((gexps (sequence %store-monad mexps)))
|
(mlet %store-monad ((gexps (sequence %store-monad mexps)))
|
||||||
(gexp->file "boot"
|
(gexp->file "boot"
|
||||||
#~(begin
|
#~(begin
|
||||||
|
@ -203,16 +203,14 @@ This is a shorthand for (map (lambda (svc) ...) %base-services)."
|
||||||
;; Activate the system and spawn dmd.
|
;; Activate the system and spawn dmd.
|
||||||
#$@gexps))))
|
#$@gexps))))
|
||||||
|
|
||||||
(define (second-argument a b) b)
|
|
||||||
|
|
||||||
(define boot-service-type
|
(define boot-service-type
|
||||||
;; The service of this type is extended by being passed gexps as monadic
|
;; The service of this type is extended by being passed gexps as monadic
|
||||||
;; values. It aggregates them in a single script, as a monadic value, which
|
;; values. It aggregates them in a single script, as a monadic value, which
|
||||||
;; becomes its 'parameters'. It is the only service that extends nothing.
|
;; becomes its 'parameters'. It is the only service that extends nothing.
|
||||||
(service-type (name 'boot)
|
(service-type (name 'boot)
|
||||||
(extensions '())
|
(extensions '())
|
||||||
(compose compute-boot-script)
|
(compose append)
|
||||||
(extend second-argument)))
|
(extend compute-boot-script)))
|
||||||
|
|
||||||
(define %boot-service
|
(define %boot-service
|
||||||
;; This is the ultimate service, the root of the service DAG.
|
;; This is the ultimate service, the root of the service DAG.
|
||||||
|
@ -296,6 +294,8 @@ ACTIVATION-SCRIPT-TYPE."
|
||||||
(mlet %store-monad ((script (activation-script gexps)))
|
(mlet %store-monad ((script (activation-script gexps)))
|
||||||
(return #~(primitive-load #$script))))
|
(return #~(primitive-load #$script))))
|
||||||
|
|
||||||
|
(define (second-argument a b) b)
|
||||||
|
|
||||||
(define activation-service-type
|
(define activation-service-type
|
||||||
(service-type (name 'activate)
|
(service-type (name 'activate)
|
||||||
(extensions
|
(extensions
|
||||||
|
|
Loading…
Reference in New Issue