Fix nixos-rebuild agent execution: run as cm user
Change sudo command to use '-u cm' to run nixos-rebuild as the cm user instead of root, allowing access to /home/cm/nixosbox directory.
This commit is contained in:
parent
6a1324ba6c
commit
864cafd61f
@ -293,8 +293,10 @@ impl Agent {
|
||||
info!("Maintenance mode enabled");
|
||||
}
|
||||
|
||||
// Change to nixos directory and execute rebuild
|
||||
// Change to nixos directory and execute rebuild as cm user
|
||||
let output = tokio::process::Command::new("sudo")
|
||||
.arg("-u")
|
||||
.arg("cm")
|
||||
.arg("nixos-rebuild")
|
||||
.arg("switch")
|
||||
.current_dir(nixos_path)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user