diff --git a/modules/wireguard/private.nix b/modules/wireguard/private.nix index 796dabb..3d4e196 100644 --- a/modules/wireguard/private.nix +++ b/modules/wireguard/private.nix @@ -44,6 +44,8 @@ in { config = mkIf (builtins.length cfg.ownIPs != 0) { networking.firewall.allowedUDPPorts = [51899]; + systemd.network.wait-online.ignoredInterfaces = [ "wg-private" ]; + systemd.services.wireguard-wg-private = { wantedBy = [ "network.target" diff --git a/modules/wireguard/pub.solar.nix b/modules/wireguard/pub.solar.nix index 7a6d79f..3943b58 100644 --- a/modules/wireguard/pub.solar.nix +++ b/modules/wireguard/pub.solar.nix @@ -24,6 +24,8 @@ in { config = mkIf (length cfg.ownIPs != 0){ networking.firewall.allowedUDPPorts = [51821]; + systemd.network.wait-online.ignoredInterfaces = [ "wg-pub-solar" ]; + systemd.services.wireguard-wg-pub-solar = { after = [ "network.target" diff --git a/modules/wireguard/tunnel.nix b/modules/wireguard/tunnel.nix index f794c58..a01ab65 100644 --- a/modules/wireguard/tunnel.nix +++ b/modules/wireguard/tunnel.nix @@ -41,6 +41,12 @@ in { config = mkIf (length cfg.ownIPs != 0){ networking.firewall.allowedUDPPorts = [51820]; + systemd.network.wait-online.ignoredInterfaces = [ "wg-tunnel" ]; + + systemd.targets.wireguard-wg-tunnel = { + wantedBy = lib.mkForce []; + }; + systemd.services.wireguard-wg-tunnel = { wants = [ "wireguard-wg-private.service"