rexxar: don't set the Endpoint in systemd-networkd unless there is one

This commit is contained in:
Luke Granger-Brown 2024-10-13 20:39:49 +01:00
parent bd83a33608
commit 73cbfc1a40

View file

@ -109,14 +109,15 @@
ListenPort = listenPort; ListenPort = listenPort;
PrivateKeyFile = privateKey; PrivateKeyFile = privateKey;
}; };
wireguardPeers = [{ wireguardPeers = [(lib.mkMerge [{
PublicKey = publicKey; PublicKey = publicKey;
AllowedIPs = [ AllowedIPs = [
"0.0.0.0/0" "0.0.0.0/0"
"::/0" "::/0"
]; ];
} (lib.mkIf (endpoint != null) {
Endpoint = endpoint; Endpoint = endpoint;
}]; })])];
}; };
swannWireguard = args: wireguard (args // { swannWireguard = args: wireguard (args // {
privateKey = config.my.vault.secrets.wg-swann-private.path; privateKey = config.my.vault.secrets.wg-swann-private.path;