Support update builds.
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user