24use tempfile::NamedTempFile;24use tempfile::NamedTempFile;
25use time::UtcDateTime;25use time::UtcDateTime;
26use tokio::task::spawn_blocking;26use tokio::task::spawn_blocking;
27use tracing::{info, warn};27use tracing::warn;
2828
29use crate::fleetdata::{29use crate::fleetdata::{
30 FleetData, FleetSecretData, FleetSecretDistribution, FleetSecretPart, SecretOwner,30 FleetData, FleetSecretData, FleetSecretDistribution, FleetSecretPart, SecretOwner,
282282
283 283
284 pub async fn remowt(&self) -> Result<Remowt> {284 pub async fn remowt(&self) -> Result<Remowt> {
285 Ok(self.connection().await?)285 self.connection().await
286 }286 }
287287
288 pub fn ensure_nix_plugin(&self) -> Pin<Box<dyn Future<Output = Result<u16>> + Send + '_>> {288 pub fn ensure_nix_plugin(&self) -> Pin<Box<dyn Future<Output = Result<u16>> + Send + '_>> {
310 .rpc()310 .rpc()
311 .wait_for_connection_to(Address::Plugin(NIX_PLUGIN_ID))311 .wait_for_connection_to(Address::Plugin(NIX_PLUGIN_ID))
312 .await312 .await
313 .map_err(|e| anyhow!("failed to wait for plugin"))?;313 .map_err(|_| anyhow!("failed to wait for plugin"))?;
314 anyhow::Ok(())314 anyhow::Ok(())
315 })315 })
316 .await?;316 .await?;
427 let store = self.nix_store().await?;427 let store = self.nix_store().await?;
428 {428 {
429 let path = path.clone();429 let path = path.clone();
430 let store = eval_store();430 let eval_store = eval_store();
431 spawn_blocking(move || store.copy_to(&store, path.as_ref()))431 spawn_blocking(move || eval_store.copy_to(&store, path.as_ref()))
432 .await432 .await
433 .expect("copy_to panicked")433 .expect("copy_to panicked")
434 .context("copying closure to remote store")?;434 .context("copying closure to remote store")?;