added root option
This commit is contained in:
11
flake.nix
11
flake.nix
@@ -17,8 +17,8 @@
|
||||
lib = pkgs.lib;
|
||||
|
||||
userOptions = config: {
|
||||
openssh.authorizedKeys.keyFiles = [ ./personal_keys ];
|
||||
extraGroups = [ "wheel" ];
|
||||
openssh.authorizedKeys.keyFiles = lib.optionals config.ssh [ ./personal_keys ];
|
||||
extraGroups = lib.optionals config.root [ "wheel" ];
|
||||
shell = lib.mkIf config.shell pkgs.zsh;
|
||||
};
|
||||
in
|
||||
@@ -47,14 +47,13 @@
|
||||
./nixosModules/scripts.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
|
||||
users.users.root = userOptions config;
|
||||
nix.settings.trusted-users = [ "root" "@wheel" ];
|
||||
users.users.${config.user} = {
|
||||
isNormalUser = true;
|
||||
} // userOptions config;
|
||||
|
||||
nix.settings.trusted-users = [ "root" "@wheel" ];
|
||||
security.sudo-rs = {
|
||||
users.users.root = lib.mkIf config.root (userOptions config);
|
||||
security.sudo-rs = lib.mkIf config.root {
|
||||
enable = true;
|
||||
execWheelOnly = false;
|
||||
wheelNeedsPassword = false;
|
||||
|
||||
Reference in New Issue
Block a user