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