mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
nixos/wireguard-networkd: fix systemd credentials not working with multiple keys per interface
This patch fixes systemd credential loading for wireguard with networkd not working when specifying more than one credential per interface by properly flattening the resulting multidimensional list instead of falling back on string concat with a space. Resolves #365402
This commit is contained in:
parent
14974d2add
commit
1fc937818d
1 changed files with 9 additions and 2 deletions
|
@ -14,7 +14,12 @@ let
|
|||
mapAttrsToList
|
||||
nameValuePair
|
||||
;
|
||||
inherit (lib.lists) concatMap concatLists filter;
|
||||
inherit (lib.lists)
|
||||
concatMap
|
||||
concatLists
|
||||
filter
|
||||
flatten
|
||||
;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) literalExpression mkOption;
|
||||
inherit (lib.strings) hasInfix;
|
||||
|
@ -215,7 +220,9 @@ in
|
|||
|
||||
systemd.timers = mapAttrs' generateRefreshTimer refreshEnabledInterfaces;
|
||||
systemd.services = (mapAttrs' generateRefreshService refreshEnabledInterfaces) // {
|
||||
systemd-networkd.serviceConfig.LoadCredential = mapAttrsToList interfaceCredentials cfg.interfaces;
|
||||
systemd-networkd.serviceConfig.LoadCredential = flatten (
|
||||
mapAttrsToList interfaceCredentials cfg.interfaces
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue