aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Trofimov <sarg@sarg.org.ru>2023-04-11 09:33:57 +0200
committerLudovic Courtès <ludo@gnu.org>2023-05-11 16:38:28 +0200
commit61031dd32fe948d927472a8ade60df6441cc6655 (patch)
treeec431a1198be310460e1324bc41b6f04d5c03801
parent8d442e8a53b8ef3727252425afe2cfb922f51368 (diff)
downloadguix-61031dd32fe948d927472a8ade60df6441cc6655.tar.gz
guix-61031dd32fe948d927472a8ade60df6441cc6655.zip
services: dhcp-client-configuration: Add 'shepherd-requirement' field.
* gnu/services/networking.scm (<dhcp-client-configuration>) [shepherd-requirement]: New field. (dhcp-client-shepherd-service): Honor it. (dhcp-client-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.texi8
-rw-r--r--gnu/services/networking.scm6
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