diff options
author | Sergey Trofimov <sarg@sarg.org.ru> | 2025-03-18 22:00:14 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2025-03-19 11:26:08 +0100 |
commit | 81a911eab8a0214706fe0f74556a6788984949c3 (patch) | |
tree | 48e8d054f1a59d9c0f6e16bb0bc70aa206d24f81 | |
parent | d9bfc66633a7a0cf9801f22f0d6a05a7c4fa4df9 (diff) | |
download | guix-81a911eab8a0214706fe0f74556a6788984949c3.tar.gz guix-81a911eab8a0214706fe0f74556a6788984949c3.zip |
services: wireguard: Add the shepherd-requirement field.
* gnu/services/vpn.scm (<wireguard-configuration>): Add
shepherd-requirement.
(wireguard-shepherd-service): Pass shepherd-requirement. Add
user-processes to requirements.
* doc/guix.texi (VPN Services):[wireguard]: Document it.
Change-Id: Ia85add5067f6f9e023b8d65d6ce067b98eeb111e
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r-- | doc/guix.texi | 4 | ||||
-rw-r--r-- | gnu/services/vpn.scm | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 0488559332..fe43ed2504 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35739,6 +35739,10 @@ be executed before tearing down the interface. List of strings or G-expressions. These are script snippets which will be executed after tearing down the interface. +@item @code{shepherd-requirement} (default: @code{'()}) (type: list-of-symbols) +A list of symbols naming Shepherd services that this service +will depend on. + @item @code{table} (default: @code{"auto"}) The routing table to which routes are added, as a string. There are two special values: @code{"off"} that disables the creation of routes diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index 478a0d543e..3f1f8661d8 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -88,6 +88,7 @@ wireguard-configuration-post-up wireguard-configuration-pre-down wireguard-configuration-post-down + wireguard-configuration-shepherd-requirement wireguard-configuration-table wireguard-configuration-auto-start? @@ -765,6 +766,8 @@ strongSwan."))) (default '())) (post-down wireguard-configuration-post-down ;list of strings (default '())) + (shepherd-requirement wireguard-configuration-shepherd-requirement ; list of symbols + (default '())) (table wireguard-configuration-table ;string (default "auto")) (auto-start? wireguard-configuration-auto-start? ;boolean @@ -918,12 +921,12 @@ public key, if any." (define (wireguard-shepherd-service config) (match-record config <wireguard-configuration> - (wireguard interface) + (wireguard interface shepherd-requirement) (let ((wg-quick (file-append wireguard "/bin/wg-quick")) (auto-start? (wireguard-configuration-auto-start? config)) (config (wireguard-configuration-file config))) (list (shepherd-service - (requirement '(networking)) + (requirement `(networking user-processes ,@shepherd-requirement)) (provision (list (wireguard-service-name interface))) (start #~(lambda _ (invoke #$wg-quick "up" #$config))) |