Support update builds.

This commit is contained in:
Tom Alexander
2026-06-25 18:25:02 -04:00
parent 606832f505
commit d341228f5b
8 changed files with 481 additions and 224 deletions

View File

@@ -8,6 +8,7 @@ use tokio::process::Command;
use crate::Result;
use crate::database::db_handle::DbHandle;
use super::RunningUpdate;
use super::running_build::RunningBuild;
pub(crate) async fn nixos_build_target<B, F, A, TN>(
@@ -59,3 +60,29 @@ where
Ok(())
}
pub(crate) async fn nix_flake_update<F>(flake_path: F) -> Result<()>
where
F: AsRef<Path>,
{
let mut command = Command::new("nix");
command.current_dir(flake_path);
command.stdout(Stdio::piped());
command.stderr(Stdio::piped());
command.stdin(Stdio::null());
command.args([
"flake",
"update",
"--log-format",
"internal-json",
"-vvvvvvvvvvv",
]);
command.kill_on_drop(true);
let child = command.spawn()?;
let mut running_update = RunningUpdate::new()?;
running_update.run_to_completion(child).await?;
Ok(())
}