summaryrefslogtreecommitdiff
path: root/gnu/services.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2021-04-16 14:39:48 +0300
committerEfraim Flashner <efraim@flashner.co.il>2021-04-16 14:39:48 +0300
commitfcc39864dba82e14895afbe841091091366c96bc (patch)
tree6e0f05495fd6512051224dc85fd3ab495cbf1a24 /gnu/services.scm
parent76fc36d0a7215979bb74c05840f5a4de4ab5ea93 (diff)
parent44f9432705d04c069a8acf9e37e3ad856ac0bf82 (diff)
downloadguix-patches-fcc39864dba82e14895afbe841091091366c96bc.tar
guix-patches-fcc39864dba82e14895afbe841091091366c96bc.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates
Conflicts: gnu/local.mk gnu/packages/boost.scm gnu/packages/chez.scm gnu/packages/compression.scm gnu/packages/crates-io.scm gnu/packages/docbook.scm gnu/packages/engineering.scm gnu/packages/gcc.scm gnu/packages/gl.scm gnu/packages/gtk.scm gnu/packages/nettle.scm gnu/packages/python-check.scm gnu/packages/python-xyz.scm gnu/packages/radio.scm gnu/packages/rust.scm gnu/packages/sqlite.scm guix/build-system/node.scm
Diffstat (limited to 'gnu/services.scm')
-rw-r--r--gnu/services.scm27
1 files changed, 19 insertions, 8 deletions
diff --git a/gnu/services.scm b/gnu/services.scm
index ddd1bac30c..e7da0a026d 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -109,7 +110,11 @@
%boot-service
%activation-service
- etc-service))
+ etc-service)
+ #:re-export (;; Note: Re-export 'delete' to allow for proper syntax matching
+ ;; in 'modify-services' forms. See
+ ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26805#16>.
+ delete))
;;; Comment:
;;;
@@ -279,7 +284,11 @@ singleton service type NAME, of which the returned service is an instance."
(service type value)))
(define-syntax %modify-service
- (syntax-rules (=>)
+ (syntax-rules (=> delete)
+ ((_ svc (delete kind) clauses ...)
+ (if (eq? (service-kind svc) kind)
+ #f
+ (%modify-service svc clauses ...)))
((_ service)
service)
((_ svc (kind param => exp ...) clauses ...)
@@ -309,16 +318,18 @@ TYPE. Consider this example:
(mingetty-service-type config =>
(mingetty-configuration
(inherit config)
- (motd (plain-file \"motd\" \"Hi there!\")))))
+ (motd (plain-file \"motd\" \"Hi there!\"))))
+ (delete udev-service-type))
It changes the configuration of the GUIX-SERVICE-TYPE instance, and that of
-all the MINGETTY-SERVICE-TYPE instances.
+all the MINGETTY-SERVICE-TYPE instances, and it deletes instances of the
+UDEV-SERVICE-TYPE.
-This is a shorthand for (map (lambda (svc) ...) %base-services)."
+This is a shorthand for (filter-map (lambda (svc) ...) %base-services)."
((_ services clauses ...)
- (map (lambda (service)
- (%modify-service service clauses ...))
- services))))
+ (filter-map (lambda (service)
+ (%modify-service service clauses ...))
+ services))))
;;;