Allow restart of tor.service without password
This commit is contained in:
parent
c60656b7c3
commit
c3ca14295e
1 changed files with 19 additions and 2 deletions
|
|
@ -1,5 +1,22 @@
|
|||
{ pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
commandsWithoutPassword = [
|
||||
"/run/current-system/sw/bin/systemctl restart tor.service"
|
||||
];
|
||||
in
|
||||
{
|
||||
security.sudo.execWheelOnly = true;
|
||||
security.sudo = {
|
||||
execWheelOnly = true;
|
||||
extraRules = [
|
||||
{
|
||||
groups = [ "wheel" ];
|
||||
commands = map
|
||||
(cmd: {
|
||||
command = cmd;
|
||||
options = [ "NOPASSWD" ];
|
||||
})
|
||||
commandsWithoutPassword;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue