diff --git a/src/nix/deployment/mod.rs b/src/nix/deployment/mod.rs index 6222e76..d9643d3 100644 --- a/src/nix/deployment/mod.rs +++ b/src/nix/deployment/mod.rs @@ -284,6 +284,7 @@ impl Deployment { // FIXME: Remote builder? let nix_options = self.hive.nix_options().await.unwrap(); let mut builder = host::local(nix_options); + builder.set_job(Some(job.clone())); let map = derivation.realize(&mut *builder).await?; diff --git a/src/nix/host/local.rs b/src/nix/host/local.rs index 76b59b9..df9daa5 100644 --- a/src/nix/host/local.rs +++ b/src/nix/host/local.rs @@ -93,6 +93,10 @@ impl Host for Local { async fn active_derivation_known(&mut self) -> NixResult { Ok(true) } + + fn set_job(&mut self, job: Option) { + self.job = job; + } } impl Local { diff --git a/src/nix/host/mod.rs b/src/nix/host/mod.rs index 2179e57..1db8647 100644 --- a/src/nix/host/mod.rs +++ b/src/nix/host/mod.rs @@ -74,6 +74,9 @@ pub trait Host: Send + Sync + std::fmt::Debug { /// exist on the host. async fn realize_remote(&mut self, derivation: &StorePath) -> NixResult>; + /// Provides a JobHandle to use during operations. + fn set_job(&mut self, bar: Option); + /// Realizes the specified local derivation on the host then retrieves the outputs. async fn realize(&mut self, derivation: &StorePath) -> NixResult> { let options = CopyOptions::default(); @@ -122,9 +125,4 @@ pub trait Host: Send + Sync + std::fmt::Debug { async fn run_command(&mut self, command: &[&str]) -> NixResult<()> { Err(NixError::Unsupported) } - - /// Provides a JobHandle to use during operations. - #[allow(unused_variables)] - fn set_job(&mut self, bar: Option) { - } }