Deploy without sudo password
This commit is contained in:
parent
35b9bd3fde
commit
695a0043e2
|
@ -113,15 +113,29 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
security.sudo = {
|
security.sudo = {
|
||||||
extraRules = [
|
extraRules =
|
||||||
|
let
|
||||||
|
storePrefix = "/nix/store/*";
|
||||||
|
systemName = "nixos-system-${config.networking.hostName}-*";
|
||||||
|
in
|
||||||
|
[
|
||||||
{
|
{
|
||||||
users = [ "%wheel" ];
|
|
||||||
commands = [
|
commands = [
|
||||||
{
|
{
|
||||||
command = "ALL";
|
command = "${storePrefix}-nix-*/bin/nix-env -p /nix/var/nix/profiles/system --set ${storePrefix}-${systemName}";
|
||||||
options = [ "SETENV" "NOPASSWD" ];
|
options = [ "NOPASSWD" ];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
groups = [ "wheel" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
commands = [
|
||||||
|
{
|
||||||
|
command = "${storePrefix}-${systemName}/bin/switch-to-configuration";
|
||||||
|
options = [ "NOPASSWD" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
groups = [ "wheel" ];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user