Allow sudo without password in init config

This commit is contained in:
Andreas Zweili 2022-11-04 15:10:16 +01:00
parent 78816b2ef5
commit 2cf56af083
1 changed files with 22 additions and 0 deletions

View File

@ -43,4 +43,26 @@
];
};
};
security.sudo = {
extraRules = [
{
users = [ "nixos" ];
commands = [
{
command = "${pkgs.nixos-rebuild}/bin/nixos-rebuild -j auto switch";
options = [ "NOPASSWD" ];
}
{
command = "/run/current-system/sw/bin/nixos-rebuild";
options = [ "NOPASSWD" ];
}
{
command = "ALL";
options = [ "SETENV" ];
}
];
}
];
};
}