diff --git a/modules/users/nixbld/default.nix b/modules/users/nixbld/default.nix index 4f12f015..ca098800 100644 --- a/modules/users/nixbld/default.nix +++ b/modules/users/nixbld/default.nix @@ -5,6 +5,8 @@ with lib; let cfg = config.users; + named = xs: listToAttrs (map (x: { name = x.name; value = x; }) xs); + createdGroups = mapAttrsToList (n: v: v.name) cfg.groups; createdUsers = mapAttrsToList (n: v: v.name) cfg.users; @@ -54,8 +56,8 @@ in { assertion = cfg.groups ? "nixbld" -> cfg.groups.nixbld.members != []; message = "refusing to remove all members from nixbld group, this would break nix"; } ]; - users.groups = mkIf cfg.nix.configureBuildUsers buildGroups; - users.users = mkIf cfg.nix.configureBuildUsers buildUsers; + users.groups = mkIf cfg.nix.configureBuildUsers (named buildGroups); + users.users = mkIf cfg.nix.configureBuildUsers (named buildUsers); users.knownGroups = mkIf cfg.nix.configureBuildUsers [ "nixbld" ]; users.knownUsers = mkIf cfg.nix.configureBuildUsers (mkUsers (i: "nixbld${toString i}")); diff --git a/tests/programs-ssh.nix b/tests/programs-ssh.nix index a6207fca..71f285c0 100644 --- a/tests/programs-ssh.nix +++ b/tests/programs-ssh.nix @@ -1,12 +1,11 @@ { config, pkgs, ... }: { - programs.ssh.knownHosts = [ - { - hostNames = [ "github.com" ]; + programs.ssh.knownHosts = { + "github.com" = { publicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="; - } - ]; + }; + }; test = '' echo >&2 "checking for github.com in /etc/ssh/ssh_known_hosts"