difftreelog
refactor use nix build to update profile generation
in: trunk
1 file changed
cmds/fleet/src/cmds/build_systems.rsdiffbeforeafterboth175 }175 }176176177 if action.should_switch_profile() && !failed {177 if action.should_switch_profile() && !failed {178 info!("switching generation");178 info!("switching system profile generation");179 // It would also be possible to update profile atomically during copy:180 // https://github.com/NixOS/nix/pull/11657179 let mut cmd = host.cmd("nix-env").await?;181 let mut cmd = host.cmd("nix").await?;182 cmd.arg("build");180 cmd.comparg("--profile", "/nix/var/nix/profiles/system")183 cmd.comparg("--profile", "/nix/var/nix/profiles/system");181 .comparg("--set", &built);184 cmd.arg(&built);182 if let Err(e) = cmd.sudo().run().await {185 if let Err(e) = cmd.sudo().run_nix().await {183 error!("failed to switch generation: {e}");186 error!("failed to switch system profile generation: {e}");184 failed = true;187 failed = true;185 }188 }186 }189 }