From 788e783ae2bc11573a8923a7648125d3bf97e88c Mon Sep 17 00:00:00 2001 From: Matthew Salerno Date: Mon, 14 Aug 2023 20:23:20 -0400 Subject: [PATCH] add peers to host file --- configurers/networkd.nix | 3 +++ configurers/static.nix | 3 +++ 2 files changed, 6 insertions(+) diff --git a/configurers/networkd.nix b/configurers/networkd.nix index b0bf997..b022d56 100644 --- a/configurers/networkd.nix +++ b/configurers/networkd.nix @@ -18,6 +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}") + ))); systemd.network = { netdevs = forEachAttr' thisPeer.subnetConnections (subnetName: subnetConnection: nameValuePair "50-wn-${subnetName}" { netdevConfig = { diff --git a/configurers/static.nix b/configurers/static.nix index a54ca27..afda64a 100644 --- a/configurers/static.nix +++ b/configurers/static.nix @@ -18,6 +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.wireguard = { interfaces = forEachAttr' thisPeer.subnetConnections (subnetName: subnetConnection: nameValuePair "wn-${subnetName}" {