summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-06-25 00:33:38 +0200
committerMarius Bakke <marius@gnu.org>2020-07-02 23:20:51 +0200
commit4d06076714f03da55d09efede055f0c40da3403e (patch)
tree806dfe030dc7aeaf817a7e84fe37937142c40cf3
parent6f8f13e941e0743d0c367baa7d5fa683d437f6bc (diff)
downloadguix-4d06076714f03da55d09efede055f0c40da3403e.tar.gz
services: wpa-supplicant: Support specifying additional service dependencies.
* gnu/services/networking.scm (<wpa-supplicant-configuration>)[requirement]:
New parameter.
(wpa-supplicant-shepherd-service): Use it instead of hard-coded list.
* doc/guix.texi (Networking Services): Document accordingly.
-rw-r--r--doc/guix.texi3
-rw-r--r--gnu/services/networking.scm9
2 files changed, 9 insertions, 3 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 7823367605..ce17c2de8e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14172,6 +14172,9 @@ It takes the following parameters:
 @item @code{wpa-supplicant} (default: @code{wpa-supplicant})
 The WPA Supplicant package to use.
 
+@item @code{requirement} (default: @code{'(user-processes dbus-system loopback syslogd)}
+List of services that should be started before WPA Supplicant starts.
+
 @item @code{dbus?} (default: @code{#t})
 Whether to listen for requests on D-Bus.
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index bd01df1ba7..348dc369d8 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -133,6 +133,7 @@
             wpa-supplicant-configuration
             wpa-supplicant-configuration?
             wpa-supplicant-configuration-wpa-supplicant
+            wpa-supplicant-configuration-requirement
             wpa-supplicant-configuration-pid-file
             wpa-supplicant-configuration-dbus?
             wpa-supplicant-configuration-interface
@@ -1319,6 +1320,8 @@ whatever the thing is supposed to do).")))
   wpa-supplicant-configuration?
   (wpa-supplicant     wpa-supplicant-configuration-wpa-supplicant ;<package>
                       (default wpa-supplicant))
+  (requirement        wpa-supplicant-configuration-requirement    ;list of symbols
+                      (default '(user-processes dbus-system loopback syslogd)))
   (pid-file           wpa-supplicant-configuration-pid-file       ;string
                       (default "/var/run/wpa_supplicant.pid"))
   (dbus?              wpa-supplicant-configuration-dbus?          ;Boolean
@@ -1332,12 +1335,12 @@ whatever the thing is supposed to do).")))
 
 (define wpa-supplicant-shepherd-service
   (match-lambda
-    (($ <wpa-supplicant-configuration> wpa-supplicant pid-file dbus? interface
-                                       config-file extra-options)
+    (($ <wpa-supplicant-configuration> wpa-supplicant requirement pid-file dbus?
+                                       interface config-file extra-options)
      (list (shepherd-service
             (documentation "Run the WPA supplicant daemon")
             (provision '(wpa-supplicant))
-            (requirement '(user-processes dbus-system loopback syslogd))
+            (requirement requirement)
             (start #~(make-forkexec-constructor
                       (list (string-append #$wpa-supplicant
                                            "/sbin/wpa_supplicant")