nixfiles/nixos/common/access.nix

27 lines
551 B
Nix

{
config,
std,
...
}: let
inherit (std) list set;
commonUser = {
openssh.authorizedKeys.keys = list.concat (set.mapToValues
(_: user:
if list.elem "wheel" user.extraGroups
then user.openssh.authorizedKeys.keys
else [])
config.users.users);
};
in {
security.pam.sshAgentAuth.enable = true;
security.sudo.enable = true;
security.pam.services.sudo.sshAgentAuth = true;
users.users = {
root = commonUser;
deploy =
commonUser
// {
isNormalUser = true;
};
};
}