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>master
parent
1545dab1fa
commit
269871d18e
|
@ -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.
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
Reference in New Issue