added sudoers file, imported to common users
This commit is contained in:
parent
f8a21f3c91
commit
8cd339297b
@ -5,6 +5,10 @@
|
|||||||
hostname,
|
hostname,
|
||||||
...
|
...
|
||||||
} @ args: {
|
} @ args: {
|
||||||
|
imports = [
|
||||||
|
../security/sudo.nix
|
||||||
|
];
|
||||||
|
|
||||||
networking.hostName = hostname;
|
networking.hostName = hostname;
|
||||||
|
|
||||||
# Don't forget to set a password with ‘passwd’!
|
# Don't forget to set a password with ‘passwd’!
|
||||||
|
3
modules/security/README.md
Normal file
3
modules/security/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Security modules
|
||||||
|
|
||||||
|
These are modules relating to security and security-related programs
|
25
modules/security/sudo.nix
Normal file
25
modules/security/sudo.nix
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; {
|
||||||
|
options = {
|
||||||
|
security.sudo = {
|
||||||
|
wheelNeedsPassword = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether users in the wheel group need to provide a password for sudo.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
environment.etc."sudoers.d/wheel-no-password" = mkIf (!config.security.sudo.wheelNeedsPassword) {
|
||||||
|
text = ''
|
||||||
|
%wheel ALL=(ALL) NOPASSWD: ALL
|
||||||
|
'';
|
||||||
|
# mode = "0440";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user