commit a5c7387e5f30dcbc379eaf88c362c743f735adb8 parent 1f1ba416430661fcfb03ae87e55883a3fad919e6 Author: Vincent Demeester <vincent@sbr.pm> Date: Mon, 1 Jun 2020 17:10:11 +0000 systems: fix authorizedKeys (optional -> optionals) Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | modules/profiles/users.nixos.nix | | | 7 | +++---- |
M | users/vincent/default.nix | | | 7 | +++---- |
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/modules/profiles/users.nixos.nix b/modules/profiles/users.nixos.nix @@ -5,13 +5,12 @@ let cfg = config.profiles.users; secretPath = ../../secrets/machines.nix; secretCondition = (builtins.pathExists secretPath); - machines = optionalAttrs secretCondition (import secretPath); - isAuthorized = p: builtins.isAttrs p && p.authorize or false; - authorizedKeys = lists.optional secretCondition ( + isAuthorized = p: builtins.isAttrs p && p.authorized or false; + authorizedKeys = lists.optionals secretCondition ( attrsets.mapAttrsToList (name: value: value.key) - (attrsets.filterAttrs (name: value: isAuthorized value) machines.ssh) + (attrsets.filterAttrs (name: value: isAuthorized value) (import secretPath).ssh) ); in { diff --git a/users/vincent/default.nix b/users/vincent/default.nix @@ -3,13 +3,12 @@ with lib; let secretPath = ../../secrets/machines.nix; secretCondition = (builtins.pathExists secretPath); - machines = optionalAttrs secretCondition (import secretPath); - isAuthorized = p: builtins.isAttrs p && p.authorize or false; - authorizedKeys = lists.optional secretCondition ( + isAuthorized = p: builtins.isAttrs p && p.authorized or false; + authorizedKeys = lists.optionals secretCondition ( attrsets.mapAttrsToList (name: value: value.key) - (attrsets.filterAttrs (name: value: isAuthorized value) machines.ssh) + (attrsets.filterAttrs (name: value: isAuthorized value) (import secretPath).ssh) ); in {