nixos/wireguard: fix dependencies on network-related targets
wireguard-${name}.service only sets up interfaces and doesn't need to connect to the Internet. See sections of these three network-related targets in systemd manuals[1][2] for more information. Also, remove the redundant multi-user.target in peer units. Fixes #142152 [1]: https://www.freedesktop.org/software/systemd/man/systemd.special.html [2]: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
This commit is contained in:
parent
b83be4516e
commit
0c795a8127
1 changed files with 6 additions and 4 deletions
|
@ -301,8 +301,9 @@ let
|
|||
{
|
||||
description = "WireGuard Peer - ${interfaceName} - ${peer.publicKey}";
|
||||
requires = [ "wireguard-${interfaceName}.service" ];
|
||||
after = [ "wireguard-${interfaceName}.service" ];
|
||||
wantedBy = [ "multi-user.target" "wireguard-${interfaceName}.service" ];
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "wireguard-${interfaceName}.service" "network-online.target" ];
|
||||
wantedBy = [ "wireguard-${interfaceName}.service" ];
|
||||
environment.DEVICE = interfaceName;
|
||||
environment.WG_ENDPOINT_RESOLUTION_RETRIES = "infinity";
|
||||
path = with pkgs; [ iproute2 wireguard-tools ];
|
||||
|
@ -379,8 +380,9 @@ let
|
|||
nameValuePair "wireguard-${name}"
|
||||
{
|
||||
description = "WireGuard Tunnel - ${name}";
|
||||
requires = [ "network-online.target" ];
|
||||
after = [ "network.target" "network-online.target" ];
|
||||
after = [ "network-pre.target" ];
|
||||
wants = [ "network.target" ];
|
||||
before = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment.DEVICE = name;
|
||||
path = with pkgs; [ kmod iproute2 wireguard-tools ];
|
||||
|
|
Loading…
Reference in a new issue