From 60ab954c7489533341e0897eea6badd856b6c358 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 13 Feb 2023 09:51:30 +0800 Subject: [PATCH] hosts/plover: update Wireguard "server" configuration --- hosts/plover/modules/services/wireguard.nix | 27 ++------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/hosts/plover/modules/services/wireguard.nix b/hosts/plover/modules/services/wireguard.nix index 6b2d91c2..14c2724c 100644 --- a/hosts/plover/modules/services/wireguard.nix +++ b/hosts/plover/modules/services/wireguard.nix @@ -12,9 +12,6 @@ let desktopPeerAddresses = with wireguardPeers.desktop; [ "${IPv4}/32" "${IPv6}/128" ]; phonePeerAddresses = with wireguardPeers.phone; [ "${IPv4}/32" "${IPv6}/128" ]; - internalDomains = [ - "~${config.networking.fqdn}" - ]; in { environment.systemPackages = [ pkgs.wireguard-tools ]; @@ -22,6 +19,8 @@ in networking.firewall.allowedUDPPorts = [ wireguardPort ]; systemd.network = { + wait-online.ignoredInterfaces = [ wireguardIFName ]; + netdevs."99-${wireguardIFName}" = { netdevConfig = { Name = wireguardIFName; @@ -57,32 +56,10 @@ in networks."99-${wireguardIFName}" = { matchConfig.Name = wireguardIFName; - networkConfig.DNS = with interfaces.internal; [ - IPv4.address - IPv6.address - ]; - - linkConfig.RequiredForOnline = "no"; - address = with interfaces.wireguard0; [ "${IPv4.address}/14" "${IPv6.address}/64" ]; - - routes = [ - { - routeConfig = { - Gateway = wireguardPeers.server.IPv4; - Destination = - let - ip = lib.strings.splitString "." wireguardPeers.server.IPv4; - properRange = lib.lists.take 3 ip ++ [ "0" ]; - ip' = lib.concatStringsSep "." properRange; - in - "${ip'}/16"; - }; - } - ]; }; }; }