Added support for remote and local realization

This commit is contained in:
soyouzpanda 2024-12-08 19:06:41 +01:00
parent eca9e7a425
commit 9b530b6ff6
Signed by: ecoppens
GPG key ID: 871893E37A732093

View file

@ -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<Vec<StorePath>> {
Ok(self
.call(
Request::Realize {
path: derivation.clone(),
remote: false
},
move |response, mut store_paths| {
match response {