diff options
author | Lassulus <github@lassul.us> | 2022-05-18 11:16:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-18 11:16:25 +0200 |
commit | a976121d5708ee6a64c09ee2af24f9a71698e6df (patch) | |
tree | ffdf8361756caf608ae4797186737c6a816c3319 /nixos | |
parent | b3e36242b1a0a7c5baf0f49a1c88258d6b6befa9 (diff) | |
parent | 0c795a8127dbed56a0accd5466f6c7ffb80638d7 (diff) |
Merge pull request #165474 from jian-lin/fix-wireguard-systemd-unit-dependency
nixos/wireguard: fix dependencies on network-related targets
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/networking/wireguard.nix | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nixos/modules/services/networking/wireguard.nix b/nixos/modules/services/networking/wireguard.nix index 7cd44b2f8a0a..a3c3c245f1d7 100644 --- a/nixos/modules/services/networking/wireguard.nix +++ b/nixos/modules/services/networking/wireguard.nix @@ -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 ]; |