Actually, nowadays, you need the specify at which commands( given by a “command=” argument) the options apply and wrapping both into a “commands=” argument - please note the plural. For the example, we will assume that none command needs password prompt. The code becomes accordingly:
security.sudo.extraRules= [
{ users = [ "privileged_user" ];
commands = [
{ command = "ALL" ;
options= [ "NOPASSWD" ]; # "SETENV" # Adding the following could be a good idea
}
];
}
];