difftreelog
feat sign in remote_derivation
in: trunk
3 files changed
crates/fleet-base/src/deploy.rsdiffbeforeafterboth--- a/crates/fleet-base/src/deploy.rs
+++ b/crates/fleet-base/src/deploy.rs
@@ -259,31 +259,11 @@
location: GenerationStorage,
generation: PathBuf,
) -> Result<PathBuf> {
- let local_host = config.local_host();
if matches!(location, GenerationStorage::Pusher) {
bail!("pusher is not enabled in this version of fleet");
}
if !host.local {
info!("uploading system closure");
- {
- // TODO: Move to remote_derivation method.
- // Alternatively, nix store make-content-addressed can be used,
- // at least for the first deployment, to provide trusted store key.
- //
- // It is much slower, yet doesn't require root on the deployer machine.
- let Ok(mut sign) = local_host.cmd("nix").await else {
- bail!("failed to setup local");
- };
- // Private key for host machine is registered in nix-sign.nix
- sign.arg("store")
- .arg("sign")
- .comparg("--key-file", "/etc/nix/private-key")
- .arg("-r")
- .arg(&generation);
- if let Err(e) = sign.sudo().run_nix().await {
- warn!("failed to sign store paths: {e}");
- };
- }
let mut tries = 0;
loop {
match host.remote_derivation(&generation).await {
crates/fleet-base/src/host.rsdiffbeforeafterboth456 // Path is located locally, thus already trusted.456 // Path is located locally, thus already trusted.457 return Ok(path.to_owned());457 return Ok(path.to_owned());458 }458 }459 let mut sign = MyCommand::new(460 // TODO: Look at the current escalation strategy.461 // ... or switch to run0 right after polkit update462 EscalationStrategy::Sudo,463 "nix",464 );465 sign.arg("store")466 .arg("sign")467 .comparg("--key-file", "/etc/nix/private-key")468 .arg("-r")469 .arg(&path);470 if let Err(e) = sign.sudo().run_nix().await {471 warn!("failed to sign store paths: {e}");472 }459 let mut nix = MyCommand::new(473 let mut nix = MyCommand::new(460 // Not used474 // Not used461 EscalationStrategy::Su,475 EscalationStrategy::Su,crates/nix-eval/src/lib.rsdiffbeforeafterboth--- a/crates/nix-eval/src/lib.rs
+++ b/crates/nix-eval/src/lib.rs
@@ -308,7 +308,6 @@
}
static GLOBAL_STATE: LazyLock<GlobalState> = LazyLock::new(|| {
- info!("initializing nix global state");
GlobalState::new().expect("global state init shouldn't fail")
});