nix/user/Root.nix

33 lines
595 B
Nix
Raw Normal View History

{
config,
lib,
secret,
...
}:
let
cfg = config.user;
2025-01-19 09:06:27 +03:00
purpose = config.module.purpose;
in
{
2025-01-19 09:06:27 +03:00
options.user.root = lib.mkEnableOption "root." // {
default = with purpose; desktop || laptop || live || server;
};
config = lib.mkIf cfg.root {
2025-01-19 09:06:27 +03:00
users.users.root.hashedPassword =
if purpose.live then secret.password.live else secret.password.root;
home.nixos.users = [
{
homeDirectory = "/root";
username = "root";
}
];
security.sudo = {
enable = false;
extraConfig = ''
Defaults rootpw
'';
};
};
}