From 8b89fed120c8076310f15ebcf4573097d9b608fd Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 3 Sep 2023 12:14:41 +0200 Subject: [PATCH] wiregrill: handle networkd carrier loss --- lass/2configs/wiregrill.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lass/2configs/wiregrill.nix b/lass/2configs/wiregrill.nix index a27e99ee2..81175c59e 100644 --- a/lass/2configs/wiregrill.nix +++ b/lass/2configs/wiregrill.nix @@ -29,17 +29,21 @@ in mkIf (hasAttr "wiregrill" config.krebs.build.host.nets) { (optional (!isNull self.ip4) "${self.ip4.addr}/16") ++ (optional (!isNull self.ip6) "${self.ip6.addr}/48") ; + networkConfig = { + IgnoreCarrierLoss = "10s"; + }; }; networking.wireguard.interfaces.wiregrill = { ips = - (optional (!isNull self.ip4) self.ip4.addr) ++ - (optional (!isNull self.ip6) self.ip6.addr); + (optional (!isNull self.ip4 && !config.systemd.network.enable) self.ip4.addr) ++ + (optional (!isNull self.ip6 && !config.systemd.network.enable) self.ip6.addr); listenPort = 51820; privateKeyFile = (toString ) + "/wiregrill.key"; allowedIPsAsRoutes = true; peers = mapAttrsToList - (_: host: { + (name: host: { + # inherit name; allowedIPs = if isRouter then (optional (!isNull host.nets.wiregrill.ip4) host.nets.wiregrill.ip4.addr) ++ (optional (!isNull host.nets.wiregrill.ip6) host.nets.wiregrill.ip6.addr)