summary refs log tree commit diff
diff options
context:
space:
mode:
authorBruno Victal <mirai@makinata.eu>2023-03-07 12:44:01 +0000
committerLudovic Courtès <ludo@gnu.org>2023-03-10 14:49:57 +0100
commit269871d18e7d1a95fbe5dfa7360208110dde9163 (patch)
tree55491ee0b07035bf2866cb8ef3b3923bdce871ff
parent1545dab1fa8a09ac7936e3a9ba1134843f178e1e (diff)
downloadguix-269871d18e7d1a95fbe5dfa7360208110dde9163.tar.gz
services: connman: Add 'shepherd-requirement' field.
* gnu/services/networking.scm (<connman-configuration>)
[shepherd-requirement]: New field.
(connman-shepherd-service): Honor it.
(connman-configuration-shepherd-requirement): Export accessor.
* doc/guix.texi (Networking Setup): Document it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--doc/guix.texi6
-rw-r--r--gnu/services/networking.scm12
2 files changed, 14 insertions, 4 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index ccaca0a71b..ece0c0354d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19917,6 +19917,12 @@ Data Type representing the configuration of connman.
 @item @code{connman} (default: @var{connman})
 The connman package to use.
 
+@item @code{shepherd-requirement} (default: @code{()})
+This option can be used to provide a list of symbols naming Shepherd services
+that this service will depend on, such as @code{'wpa-supplicant} or
+@code{'iwd} if you require authenticated access for encrypted WiFi or Ethernet
+networks.
+
 @item @code{disable-vpn?} (default: @code{#f})
 When true, disable connman's vpn plugin.
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index abfaba8004..6a09f6e728 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -151,6 +151,7 @@
             connman-configuration
             connman-configuration?
             connman-configuration-connman
+            connman-configuration-shepherd-requirement
             connman-configuration-disable-vpn?
             connman-configuration-iwd?
             connman-service-type
@@ -1288,6 +1289,8 @@ wireless networking."))))
   connman-configuration?
   (connman      connman-configuration-connman
                 (default connman))
+  (shepherd-requirement connman-configuration-shepherd-requirement
+                        (default '()))
   (disable-vpn? connman-configuration-disable-vpn?
                 (default #f))
   (iwd?         connman-configuration-iwd?
@@ -1303,13 +1306,14 @@ wireless networking."))))
             (mkdir-p "/var/lib/connman-vpn/"))))))
 
 (define (connman-shepherd-service config)
-  (match-record config <connman-configuration> (connman disable-vpn? iwd?)
+  (match-record config <connman-configuration> (connman shepherd-requirement
+                                                disable-vpn? iwd?)
     (list (shepherd-service
            (documentation "Run Connman")
            (provision '(networking))
-           (requirement
-            (append '(user-processes dbus-system loopback)
-                    (if iwd? '(iwd) '())))
+           (requirement `(user-processes dbus-system loopback
+                          ,@shepherd-requirement
+                          ,@(if iwd? '(iwd) '())))
            (start #~(make-forkexec-constructor
                      (list (string-append #$connman
                                           "/sbin/connmand")