mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 06:06:53 -05:00
services: 'shepherd-service-type' now accepts a default value.
* gnu/services/shepherd.scm (shepherd-service-type): Add a second form with an additional 'default' parameter.
This commit is contained in:
parent
61b1dbbdcd
commit
88cd7bbd3d
1 changed files with 18 additions and 8 deletions
|
@ -104,14 +104,24 @@ (define %shepherd-root-service
|
||||||
;; <shepherd-service> objects.
|
;; <shepherd-service> objects.
|
||||||
(service shepherd-root-service-type '()))
|
(service shepherd-root-service-type '()))
|
||||||
|
|
||||||
(define-syntax-rule (shepherd-service-type service-name proc)
|
(define-syntax shepherd-service-type
|
||||||
"Return a <service-type> denoting a simple shepherd service--i.e., the type
|
(syntax-rules ()
|
||||||
for a service that extends SHEPHERD-ROOT-SERVICE-TYPE and nothing else."
|
"Return a <service-type> denoting a simple shepherd service--i.e., the type
|
||||||
(service-type
|
for a service that extends SHEPHERD-ROOT-SERVICE-TYPE and nothing else. When
|
||||||
(name service-name)
|
DEFAULT is given, use it as the service's default value."
|
||||||
(extensions
|
((_ service-name proc default)
|
||||||
(list (service-extension shepherd-root-service-type
|
(service-type
|
||||||
(compose list proc))))))
|
(name service-name)
|
||||||
|
(extensions
|
||||||
|
(list (service-extension shepherd-root-service-type
|
||||||
|
(compose list proc))))
|
||||||
|
(default-value default)))
|
||||||
|
((_ service-name proc)
|
||||||
|
(service-type
|
||||||
|
(name service-name)
|
||||||
|
(extensions
|
||||||
|
(list (service-extension shepherd-root-service-type
|
||||||
|
(compose list proc))))))))
|
||||||
|
|
||||||
(define %default-imported-modules
|
(define %default-imported-modules
|
||||||
;; Default set of modules imported for a service's consumption.
|
;; Default set of modules imported for a service's consumption.
|
||||||
|
|
Loading…
Reference in a new issue