nix/home/user/Root.nix

34 lines
479 B
Nix
Raw Permalink Normal View History

{
lib,
config,
secret,
...
}:
with lib;
let
cfg = config.user.root;
in
{
options = {
user.root = {
enable = mkEnableOption "root";
};
};
config = mkIf cfg.enable {
home.nixos.users = [
{
username = "root";
homeDirectory = "/root";
}
];
users.users.root.hashedPassword = secret.hashedPassword;
security.sudo = {
enable = false;
extraConfig = ''
Defaults rootpw
'';
};
};
}