summary refs log tree commit diff
path: root/gnu/services/dbus.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-02 22:35:49 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-05 15:39:35 +0200
commitaa071ca049c4324c790b3364e6c4c8e886d26a9e (patch)
tree86fd0ca3d1c0642e9cedddc826fcab4f33fa0d4c /gnu/services/dbus.scm
parentf63861b5a61b2a9d2c17dbf88b24b5e8f0c5c111 (diff)
downloadguix-aa071ca049c4324c790b3364e6c4c8e886d26a9e.tar.gz
services: dbus: 'wrapped-dbus-service' accepts a list of variables.
* gnu/services/dbus.scm (wrapped-dbus-service): Replace 'variable' and
'value' by 'variables', and adjust code accordingly.
* gnu/services/desktop.scm (upower-dbus-service):
(geoclue-dbus-service, elogind-dbus-service): Adjust accordingly.
Diffstat (limited to 'gnu/services/dbus.scm')
-rw-r--r--gnu/services/dbus.scm14
1 files changed, 10 insertions, 4 deletions
diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
index 3d2dbb903c..35d7ff3c9c 100644
--- a/gnu/services/dbus.scm
+++ b/gnu/services/dbus.scm
@@ -231,14 +231,20 @@ and policy files.  For example, to allow avahi-daemon to use the system bus,
            (dbus-configuration (dbus dbus)
                                (services services))))
 
-(define (wrapped-dbus-service service program variable value)
+(define (wrapped-dbus-service service program variables)
   "Return a wrapper for @var{service}, a package containing a D-Bus service,
-where @var{program} is wrapped such that environment variable @var{variable}
-is set to @var{value} when the bus daemon launches it."
+where @var{program} is wrapped such that @var{variables}, a list of name/value
+tuples, are all set as environment variables when the bus daemon launches it."
   (define wrapper
     (program-file (string-append (package-name service) "-program-wrapper")
                   #~(begin
-                      (setenv #$variable #$value)
+                      (use-modules (ice-9 match))
+
+                      (for-each (match-lambda
+                                  ((variable value)
+                                   (setenv variable value)))
+                                '#$variables)
+
                       (apply execl (string-append #$service "/" #$program)
                              (string-append #$service "/" #$program)
                              (cdr (command-line))))))