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;
PrivateKeyFile = privateKey;
};
wireguardPeers = [{
wireguardPeers = [(lib.mkMerge [{
PublicKey = publicKey;
AllowedIPs = [
"0.0.0.0/0"
"::/0"
];
} (lib.mkIf (endpoint != null) {
Endpoint = endpoint;
}];
})])];
};
swannWireguard = args: wireguard (args // {
privateKey = config.my.vault.secrets.wg-swann-private.path;