Allow restart of tor.service without password

This commit is contained in:
Jakob Lechner 2023-09-24 10:59:51 +00:00
parent c60656b7c3
commit c3ca14295e
No known key found for this signature in database
GPG key ID: 996082EFB5906C10

View file

@ -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;
}
];
};
}