Use sudo without password

This commit is contained in:
Andreas Zweili 2023-12-19 21:39:11 +01:00
parent 4fdef85b46
commit fcc657c9c2
1 changed files with 1 additions and 34 deletions

View File

@ -111,40 +111,7 @@
};
security.sudo = {
extraRules =
let
storePrefix = "/nix/store/*";
systemName = "nixos-system-${config.networking.hostName}-*";
in
[
{
commands = [
{
command = "${storePrefix}-nix-*/bin/nix-env -p /nix/var/nix/profiles/system --set ${storePrefix}-${systemName}";
options = [ "NOPASSWD" ];
}
];
groups = [ "wheel" ];
}
{
commands = [
{
command = "${storePrefix}-${systemName}/bin/switch-to-configuration";
options = [ "NOPASSWD" ];
}
];
groups = [ "wheel" ];
}
{
commands = [
{
command = "/run/current-system/sw/bin/reboot";
options = [ "NOPASSWD" ];
}
];
groups = [ "wheel" ];
}
];
wheelNeedsPassword = false;
};
system.activationScripts.diff = {