infrastructure/nixos/base/access.nix
2024-09-20 19:14:47 -07:00

38 lines
864 B
Nix
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
config,
pkgs,
meta,
...
}: {
security.sudo.wheelNeedsPassword = false;
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});
'';
imports = let
inherit (meta) nixos;
in [
nixos.users
];
users.motd = ''
${config.networking.hostName}.${config.networking.domain}
'';
users.defaultUserShell = pkgs.zsh;
users.users.root = {
hashedPassword = "$6$SLue7utn4qXtW1TE$yQOliCPKgkiFST5H6iqCCwT2dn3o4e/h39MaCbhOXVreFQrkWe7ZzJUOzC0u28/0.Hzs6xKSiJnGjbLXvGstr1";
openssh.authorizedKeys.keys = with pkgs.lib; (concatLists (mapAttrsToList
(name: user:
if elem "wheel" user.extraGroups
then user.openssh.authorizedKeys.keys
else [])
config.users.users));
};
}