From 9b530b6ff66299c2fa272c46f1f8953acc8c7b5d Mon Sep 17 00:00:00 2001 From: soyouzpanda Date: Sun, 8 Dec 2024 19:06:41 +0100 Subject: [PATCH] Added support for remote and local realization --- src/nix/host/generic.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/nix/host/generic.rs b/src/nix/host/generic.rs index 29d8516..48c52bf 100644 --- a/src/nix/host/generic.rs +++ b/src/nix/host/generic.rs @@ -53,6 +53,7 @@ pub enum Request { /// Realizes the derivation Realize { path: StorePath, + remote: bool, }, /// Uploads keys to host @@ -116,6 +117,27 @@ impl Host for GenericHost { .call( Request::Realize { path: derivation.clone(), + remote: true + }, + move |response, mut store_paths| { + match response { + Response::Progress { phase } => println!("{}", phase), + Response::NewStorePath { store_path } => store_paths.push(store_path), + _ => (), + }; + store_paths + }, + Vec::new(), + ) + .await?) + } + + async fn realize(&mut self, derivation: &StorePath) -> ColmenaResult> { + Ok(self + .call( + Request::Realize { + path: derivation.clone(), + remote: false }, move |response, mut store_paths| { match response {