diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2015-11-02 17:01:32 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2015-11-02 22:25:11 +0100 |
| commit | 3a391e68dafe81560d3e4936a1ec5ac3b06d43bb (patch) | |
| tree | 1e5745494a5120faed67ad137e13a8ffc64cae54 | |
| parent | 5adbe65feceeb6d2a08abe644f4a66f598985182 (diff) | |
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.
| -rw-r--r-- | gnu/services.scm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gnu/services.scm b/gnu/services.scm index c8a2a2604f8..ecf3532e52e 100644 --- a/gnu/services.scm +++ b/gnu/services.scm | |||
| @@ -182,7 +182,7 @@ This is a shorthand for (map (lambda (svc) ...) %base-services)." | |||
| 182 | ;;; Core services. | 182 | ;;; Core services. |
| 183 | ;;; | 183 | ;;; |
| 184 | 184 | ||
| 185 | (define (compute-boot-script mexps) | 185 | (define (compute-boot-script _ mexps) |
| 186 | (mlet %store-monad ((gexps (sequence %store-monad mexps))) | 186 | (mlet %store-monad ((gexps (sequence %store-monad mexps))) |
| 187 | (gexp->file "boot" | 187 | (gexp->file "boot" |
| 188 | #~(begin | 188 | #~(begin |
| @@ -203,16 +203,14 @@ This is a shorthand for (map (lambda (svc) ...) %base-services)." | |||
| 203 | ;; Activate the system and spawn dmd. | 203 | ;; Activate the system and spawn dmd. |
| 204 | #$@gexps)))) | 204 | #$@gexps)))) |
| 205 | 205 | ||
| 206 | (define (second-argument a b) b) | ||
| 207 | |||
| 208 | (define boot-service-type | 206 | (define boot-service-type |
| 209 | ;; The service of this type is extended by being passed gexps as monadic | 207 | ;; The service of this type is extended by being passed gexps as monadic |
| 210 | ;; values. It aggregates them in a single script, as a monadic value, which | 208 | ;; values. It aggregates them in a single script, as a monadic value, which |
| 211 | ;; becomes its 'parameters'. It is the only service that extends nothing. | 209 | ;; becomes its 'parameters'. It is the only service that extends nothing. |
| 212 | (service-type (name 'boot) | 210 | (service-type (name 'boot) |
| 213 | (extensions '()) | 211 | (extensions '()) |
| 214 | (compose compute-boot-script) | 212 | (compose append) |
| 215 | (extend second-argument))) | 213 | (extend compute-boot-script))) |
| 216 | 214 | ||
| 217 | (define %boot-service | 215 | (define %boot-service |
| 218 | ;; This is the ultimate service, the root of the service DAG. | 216 | ;; This is the ultimate service, the root of the service DAG. |
| @@ -296,6 +294,8 @@ ACTIVATION-SCRIPT-TYPE." | |||
| 296 | (mlet %store-monad ((script (activation-script gexps))) | 294 | (mlet %store-monad ((script (activation-script gexps))) |
| 297 | (return #~(primitive-load #$script)))) | 295 | (return #~(primitive-load #$script)))) |
| 298 | 296 | ||
| 297 | (define (second-argument a b) b) | ||
| 298 | |||
| 299 | (define activation-service-type | 299 | (define activation-service-type |
| 300 | (service-type (name 'activate) | 300 | (service-type (name 'activate) |
| 301 | (extensions | 301 | (extensions |
