Files
dev/modules/optionnal/sudo-nopasswd.nix
2025-07-23 04:27:38 +02:00

25 lines
459 B
Nix

{
username,
...
}:
{
# https://dev.to/patimapoochai/how-to-edit-the-sudoers-file-in-nixos-with-examples-4k34
security.sudo = {
enable = true;
extraRules = [
{
users = [ "${username}" ];
host = "ALL";
runAs = "ALL:ALL";
commands = [
{
command = "ALL";
options = [ "NOPASSWD" ];
}
];
}
];
#extraConfig = "#includedir /etc/sudoers.d";
};
}