aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-09-19 13:31:06 +0900
committerLudovic Courtès <ludo@gnu.org>2016-09-19 23:11:19 +0900
commit71654dfdda4890d7a663a36a7fe754b53591aba6 (patch)
treefda1be459091f59487413a53b791bdd68cbb46c8 /gnu
parentbf307a7a54eeca405e5c6ad50a9cbe6b9e10190d (diff)
downloadpatches-71654dfdda4890d7a663a36a7fe754b53591aba6.tar
patches-71654dfdda4890d7a663a36a7fe754b53591aba6.tar.gz
services: Add 'simple-service'.
* gnu/services.scm (simple-service): New procedure. * doc/guix.texi (Service Reference): Document it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/services.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/gnu/services.scm b/gnu/services.scm
index 5479bfae19..7e322c50b0 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -50,6 +50,7 @@
service-kind
service-parameters
+ simple-service
modify-services
service-back-edges
fold-services
@@ -141,6 +142,13 @@
(type service-kind)
(parameters service-parameters))
+(define (simple-service name target value)
+ "Return a service that extends TARGET with VALUE. This works by creating a
+singleton service type NAME, of which the returned service is an instance."
+ (let* ((extension (service-extension target identity))
+ (type (service-type (name name)
+ (extensions (list extension)))))
+ (service type value)))
(define-syntax %modify-service
(syntax-rules (=>)