aboutsummaryrefslogtreecommitdiff
path: root/gnu/services/shepherd.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-03-18 01:09:25 +0100
committerMarius Bakke <mbakke@fastmail.com>2018-03-18 01:09:25 +0100
commit7ace97395feedc4b3ec23be65f2ed63f29aac9a9 (patch)
tree768956fa30fc7b21e4e4715eafbb10dab32b2847 /gnu/services/shepherd.scm
parenta248a9ac6a67213b177ab5ba9ec270638c9dd002 (diff)
parentbe5ed142135e939cd23fcfe88c553fd28b32ac53 (diff)
downloadguix-7ace97395feedc4b3ec23be65f2ed63f29aac9a9.tar
guix-7ace97395feedc4b3ec23be65f2ed63f29aac9a9.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/services/shepherd.scm')
-rw-r--r--gnu/services/shepherd.scm26
1 files changed, 18 insertions, 8 deletions
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index f7c6983cb0..000e85eb86 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -104,14 +104,24 @@
;; <shepherd-service> objects.
(service shepherd-root-service-type '()))
-(define-syntax-rule (shepherd-service-type service-name proc)
- "Return a <service-type> denoting a simple shepherd service--i.e., the type
-for a service that extends SHEPHERD-ROOT-SERVICE-TYPE and nothing else."
- (service-type
- (name service-name)
- (extensions
- (list (service-extension shepherd-root-service-type
- (compose list proc))))))
+(define-syntax shepherd-service-type
+ (syntax-rules ()
+ "Return a <service-type> denoting a simple shepherd service--i.e., the type
+for a service that extends SHEPHERD-ROOT-SERVICE-TYPE and nothing else. When
+DEFAULT is given, use it as the service's default value."
+ ((_ service-name proc default)
+ (service-type
+ (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
;; Default set of modules imported for a service's consumption.