From bd9c2b14e5e80cd8750562f88cf5cb42dfc5bc03 Mon Sep 17 00:00:00 2001 From: Matthew Salerno Date: Mon, 14 Aug 2023 20:46:30 -0400 Subject: [PATCH] fix hosts file --- configurers/networkd.nix | 6 +++--- configurers/static.nix | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configurers/networkd.nix b/configurers/networkd.nix index b022d56..984a86a 100644 --- a/configurers/networkd.nix +++ b/configurers/networkd.nix @@ -18,9 +18,9 @@ let in with getKeyProviderFuncs keyProviders inputs intermediateConfig peerName; { - networking.extraHosts = concatStringsSep "\n" (concatLists (forEachAttrToList thisPeer.subnetConnections (subnetName: subnetConnection: - forEachAttrToList subnetConnection.peerConnections (otherPeerName: peerConnection: "${peerConnection.endpoint.ip} ${peerName}.${subnetName}") - ))); + networking.extraHosts = concatStringsSep "\n" (concatLists ( concatLists (forEachAttrToList thisPeer.subnetConnections (subnetName: subnetConnection: + forEachAttrToList subnetConnection.peerConnections (otherPeerName: peerConnection: forEach peerConnection.ipAddresses (ip: "${strings.removeSuffix "/64" ip} ${otherPeerName}.${subnetName}")) + )))); systemd.network = { netdevs = forEachAttr' thisPeer.subnetConnections (subnetName: subnetConnection: nameValuePair "50-wn-${subnetName}" { netdevConfig = { diff --git a/configurers/static.nix b/configurers/static.nix index afda64a..4057ee9 100644 --- a/configurers/static.nix +++ b/configurers/static.nix @@ -18,9 +18,9 @@ let in with getKeyProviderFuncs keyProviders inputs intermediateConfig peerName; { - networking.extraHosts = concatStringsSep "\n" (concatLists (forEachAttrToList thisPeer.subnetConnections (subnetName: subnetConnection: - (forEachAttrToList subnetConnection.peerConnections (otherPeerName: peerConnection: "${peerConnection.endpoint.ip} ${peerName}.${subnetName}")) - ))); + networking.extraHosts = concatStringsSep "\n" (concatLists ( concatLists (forEachAttrToList thisPeer.subnetConnections (subnetName: subnetConnection: + forEachAttrToList subnetConnection.peerConnections (otherPeerName: peerConnection: forEach peerConnection.ipAddresses (ip: "${strings.removeSuffix "/64" ip} ${otherPeerName}.${subnetName}")) + )))); networking.wireguard = { interfaces = forEachAttr' thisPeer.subnetConnections (subnetName: subnetConnection: nameValuePair "wn-${subnetName}" {