Fix nixos-rebuild sudo path mismatch

Use explicit /run/current-system/sw/bin/nixos-rebuild path instead of
'nixos-rebuild' command to match sudo rules exactly. This resolves
'command not allowed' errors when the command resolves to nix store paths.
This commit is contained in:
Christoffer Martinsson 2025-10-24 19:39:08 +02:00
parent 114ad52ae8
commit 7b7e323fd8

View File

@ -302,7 +302,7 @@ impl Agent {
tokio::process::Command::new("sudo") tokio::process::Command::new("sudo")
.arg("-u") .arg("-u")
.arg("cm") .arg("cm")
.arg("nixos-rebuild") .arg("/run/current-system/sw/bin/nixos-rebuild")
.arg("switch") .arg("switch")
.current_dir(working_dir) .current_dir(working_dir)
.output() .output()