summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-10-10 13:40:40 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2021-10-10 13:40:40 +0200
commitaa2c9c9b39297e930a1fdfd81827c707873878ba (patch)
tree41aa94b61500ce00f9ba4c808e55edc88886a28e
parent36f532f5dda1cd1a9bc9a4061f9e218bc2126dec (diff)
downloadnixos-aa2c9c9b39297e930a1fdfd81827c707873878ba.tar
nixos-aa2c9c9b39297e930a1fdfd81827c707873878ba.tar.gz
nixos-aa2c9c9b39297e930a1fdfd81827c707873878ba.tar.bz2
nixos-aa2c9c9b39297e930a1fdfd81827c707873878ba.tar.xz
nixos-aa2c9c9b39297e930a1fdfd81827c707873878ba.zip
yggdrasil-wg: ...
-rw-r--r--modules/yggdrasil-wg/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/yggdrasil-wg/default.nix b/modules/yggdrasil-wg/default.nix
index 6b0405d9..73f8c368 100644
--- a/modules/yggdrasil-wg/default.nix
+++ b/modules/yggdrasil-wg/default.nix
@@ -74,7 +74,7 @@ in {
74 allowedIPsAsRoutes = false; 74 allowedIPsAsRoutes = false;
75 inherit listenPort; 75 inherit listenPort;
76 ips = hostIPs.${hostName}; 76 ips = hostIPs.${hostName};
77 peers = imap0 linkToPeer hostLinks; 77 peers = filter (value: value != null) (imap0 (ix: opts@{to, from, ...}: if from == hostName || to == hostName then linkToPeer ix opts else null) links);
78 privateKeyFile = config.sops.secrets."yggdrasil-wg.priv".path; 78 privateKeyFile = config.sops.secrets."yggdrasil-wg.priv".path;
79 postSetup = '' 79 postSetup = ''
80 ${concatMapStringsSep "\n" (linkArgs: let other = if linkArgs.from == hostName then linkArgs.to else linkArgs.from; in concatMapStringsSep "\n" (otherIP: "ip route replace \"${otherIP}\" dev \"yggdrasil\" table \"main\"") hostIPs.${other}) hostLinks} 80 ${concatMapStringsSep "\n" (linkArgs: let other = if linkArgs.from == hostName then linkArgs.to else linkArgs.from; in concatMapStringsSep "\n" (otherIP: "ip route replace \"${otherIP}\" dev \"yggdrasil\" table \"main\"") hostIPs.${other}) hostLinks}