ALPHA: wire is a tool to deploy nixos systems wire.althaea.zone/
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

add `--substitute-on-destination` arg (#375)

authored by

marshmallow and committed by
GitHub
b27e1144 ffc72a3e

+20 -1
+4
CHANGELOG.md
··· 7 7 8 8 ## [Unreleased] - yyyy-mm-dd 9 9 10 + ### Added 11 + 12 + - Add a `--substitute-on-destination` argument. 13 + 10 14 ## [v1.0.0] - 2025-12-17 11 15 12 16 ### Added
+1
crates/cli/src/apply.rs
··· 121 121 hive_location: location.clone(), 122 122 modifiers, 123 123 reboot: args.reboot, 124 + substitute_on_destination: args.substitute_on_destination, 124 125 should_apply_locally, 125 126 handle_unreachable: args.handle_unreachable.clone().into(), 126 127 should_shutdown: should_shutdown.clone(),
+5
crates/cli/src/cli.rs
··· 132 132 } 133 133 } 134 134 135 + #[allow(clippy::struct_excessive_bools)] 135 136 #[derive(Args)] 136 137 pub struct ApplyArgs { 137 138 #[arg(value_enum, default_value_t)] ··· 158 159 /// Reboot the nodes after activation 159 160 #[arg(short, long, default_value_t = false)] 160 161 pub reboot: bool, 162 + 163 + /// Enable `--substitute-on-destination` in Nix subcommands. 164 + #[arg(short, long, default_value_t = true)] 165 + pub substitute_on_destination: bool, 161 166 162 167 /// How to handle an unreachable node in the ping step. 163 168 ///
+6 -1
crates/core/src/commands/common.rs
··· 28 28 pub async fn push(context: &Context<'_>, push: Push<'_>) -> Result<(), HiveLibError> { 29 29 let command_string = format!( 30 30 "nix --extra-experimental-features nix-command \ 31 - copy --substitute-on-destination --to ssh://{user}@{host} {path}", 31 + copy {substitute} --to ssh://{user}@{host} {path}", 32 32 user = context.node.target.user, 33 33 host = context.node.target.get_preferred_host()?, 34 34 path = match push { 35 35 Push::Derivation(drv) => format!("{drv} --derivation"), 36 36 Push::Path(path) => path.clone(), 37 + }, 38 + substitute = if context.substitute_on_destination { 39 + "--substitute-on-destination" 40 + } else { 41 + "" 37 42 } 38 43 ); 39 44
+4
crates/core/src/hive/node.rs
··· 115 115 goal: Goal::SwitchToConfiguration(SwitchToConfigurationGoal::Switch), 116 116 reboot: false, 117 117 should_apply_locally: false, 118 + substitute_on_destination: false, 118 119 handle_unreachable: HandleUnreachable::default(), 119 120 should_shutdown: Arc::new(AtomicBool::new(false)), 120 121 } ··· 296 297 pub key_agent_directory: Option<String>, 297 298 } 298 299 300 + // TODO: Get rid of this allow and resolve it 301 + #[allow(clippy::struct_excessive_bools)] 299 302 pub struct Context<'a> { 300 303 pub name: &'a Name, 301 304 pub node: &'a mut Node, ··· 306 309 pub goal: Goal, 307 310 pub reboot: bool, 308 311 pub should_apply_locally: bool, 312 + pub substitute_on_destination: bool, 309 313 pub handle_unreachable: HandleUnreachable, 310 314 pub should_shutdown: Arc<AtomicBool>, 311 315 }