0
0
Fork 0
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:
networkException 2024-12-27 23:11:40 +01:00
parent 5ea8221772
commit e7e42de5a7
No known key found for this signature in database
GPG key ID: E3877443AE684391

View file

@ -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;