dn42: make wireguard.endpoint optional

This commit is contained in:
Astro 2020-04-24 19:40:49 +02:00
parent 6ca8d9bb25
commit 150fd52178
1 changed files with 4 additions and 2 deletions

View File

@ -80,10 +80,12 @@ in {
inherit (conf.wireguard) listenPort privateKey;
ips = [ "${address4}/32" "${address6}/128" ];
peers = [ {
inherit (conf.wireguard) endpoint publicKey;
inherit (conf.wireguard) publicKey;
allowedIPs = [ "0.0.0.0/0" "::0/0" ];
persistentKeepalive = 30;
} ];
} // (lib.optionalAttrs (conf.wireguard ? endpoint) {
inherit (conf.wireguard) endpoint;
})];
}) wireguardNeighbors;
};