diff options
-rw-r--r-- | doc/guix.texi | 8 | ||||
-rw-r--r-- | gnu/services/networking.scm | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 27fc3b1689..2871fb9957 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20000,6 +20000,12 @@ should listen on---e.g., @code{'("eno1")}. When set to @code{'all}, the DHCP client listens on all the available non-loopback interfaces that can be activated. Otherwise the DHCP client listens only on the specified interfaces. + +@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. @end table @end deftp @@ -20103,7 +20109,7 @@ Data Type representing the configuration of connman. @item @code{connman} (default: @var{connman}) The connman package to use. -@item @code{shepherd-requirement} (default: @code{()}) +@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 diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 866368aa90..eb1fb6a7da 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -89,6 +89,7 @@ dhcp-client-configuration? dhcp-client-configuration-package dhcp-client-configuration-interfaces + dhcp-client-configuration-shepherd-requirement dhcpd-service-type dhcpd-configuration @@ -288,6 +289,8 @@ dhcp-client-configuration? (package dhcp-client-configuration-package ;file-like (default isc-dhcp)) + (shepherd-requirement dhcp-client-configuration-shepherd-requirement + (default '())) (interfaces dhcp-client-configuration-interfaces (default 'all))) ;'all | list of strings @@ -295,11 +298,12 @@ (match-lambda ((? dhcp-client-configuration? config) (let ((package (dhcp-client-configuration-package config)) + (shepherd-requirement (dhcp-client-configuration-shepherd-requirement config)) (interfaces (dhcp-client-configuration-interfaces config)) (pid-file "/var/run/dhclient.pid")) (list (shepherd-service (documentation "Set up networking via DHCP.") - (requirement '(user-processes udev)) + (requirement `(user-processes udev ,@shepherd-requirement)) ;; XXX: Running with '-nw' ("no wait") avoids blocking for a minute when ;; networking is unavailable, but also means that the interface is not up |