mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-12 05:16:25 +03:00
nixos/wireguard-networkd: only set PresharedKey credential when given a file
This patch fixes an oversight in the initial implementation
of using systemd credentials in 6bc8dcc630
that would cause a warning to be logged about a missing credential
when presharedKeyFile wasn't set.
This commit is contained in:
parent
5ea8221772
commit
e7e42de5a7
1 changed files with 2 additions and 1 deletions
|
@ -61,7 +61,8 @@ let
|
||||||
interfaceName: peer:
|
interfaceName: peer:
|
||||||
removeNulls {
|
removeNulls {
|
||||||
PublicKey = peer.publicKey;
|
PublicKey = peer.publicKey;
|
||||||
PresharedKey = "@${presharedKeyCredential interfaceName peer}";
|
PresharedKey =
|
||||||
|
if peer.presharedKeyFile == null then null else "@${presharedKeyCredential interfaceName peer}";
|
||||||
AllowedIPs = peer.allowedIPs;
|
AllowedIPs = peer.allowedIPs;
|
||||||
Endpoint = peer.endpoint;
|
Endpoint = peer.endpoint;
|
||||||
PersistentKeepalive = peer.persistentKeepalive;
|
PersistentKeepalive = peer.persistentKeepalive;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue