diff --git a/agent/src/agent.rs b/agent/src/agent.rs index b5d957a..c061d88 100644 --- a/agent/src/agent.rs +++ b/agent/src/agent.rs @@ -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)