From 26612665c169dd31479cd568ec70ac628564636f Mon Sep 17 00:00:00 2001 From: 514fpv Date: Sat, 30 Mar 2024 14:09:52 +0800 Subject: [PATCH] global(auth): translate key list --- global/auth/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/global/auth/default.nix b/global/auth/default.nix index aaad15f3..45e245fd 100644 --- a/global/auth/default.nix +++ b/global/auth/default.nix @@ -7,6 +7,8 @@ builtins.readDir (lib.filterAttrs (n: ty: ty == "regular")) (lib.mapAttrsToList (n: _: builtins.readFile ./pub/${n})) + (foldr (payload: keys: (splitString "\n" payload) ++ keys) [ ]) + (foldr (candidate: keys: keys ++ (if candidate == "" then [ ] else [ candidate ])) [ ]) ]; in { options.global.auth = { @@ -15,7 +17,7 @@ in { enable = mkEnableOption "openssh server"; password = mkEnableOption "password authentication"; publicKeys = mkOption { - type = with types; listOf str; + type = with types; listOf singleLineStr; default = pub; description = "list of trusted openssh keys"; };