summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-09-03 12:14:41 +0200
committerlassulus <git@lassul.us>2023-09-03 12:14:41 +0200
commit8b89fed120c8076310f15ebcf4573097d9b608fd (patch)
treeb5dc0de18facd93ff510e701fb3c0e087d9206fa
parentd08fc3f507177da3f904390977a084406a37339d (diff)
wiregrill: handle networkd carrier loss
-rw-r--r--lass/2configs/wiregrill.nix10
1 files 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 <secrets>) + "/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)