2024-10-11 23:27:07 +03:00
|
|
|
{
|
2024-12-18 09:40:11 +03:00
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
secret,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
cfg = config.user;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.user.root = lib.mkEnableOption "root.";
|
2024-06-30 03:56:48 +03:00
|
|
|
|
2024-12-18 09:40:11 +03:00
|
|
|
config = lib.mkIf cfg.root {
|
|
|
|
users.users.root.hashedPassword = secret.hashedPassword;
|
|
|
|
home.nixos.users = [
|
|
|
|
{
|
|
|
|
homeDirectory = "/root";
|
|
|
|
username = "root";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
security.sudo = {
|
|
|
|
enable = false;
|
|
|
|
extraConfig = ''
|
|
|
|
Defaults rootpw
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2024-06-30 03:56:48 +03:00
|
|
|
}
|