nixos-configuration/modules/sudo.nix
2023-11-08 23:46:36 +00:00

22 lines
409 B
Nix

{ pkgs, inputs, ... }:
let
commandsWithoutPassword = [
"/run/current-system/sw/bin/systemctl restart tor.service"
];
in
{
security.sudo = {
execWheelOnly = true;
extraRules = [
{
groups = [ "wheel" ];
commands = map
(cmd: {
command = cmd;
options = [ "NOPASSWD" ];
})
commandsWithoutPassword;
}
];
};
}