From 884db6f4399f353f2c47a407ddcc42d2c2041f27 Mon Sep 17 00:00:00 2001 From: ento Date: Thu, 26 Dec 2024 10:53:55 -0800 Subject: [PATCH 1/2] devenv: append extra copy args one by one Previously a third argument was always added, even if copy_args was empty, breaking the conditional in the copy-container script that determines whether to use defaultCopyArgs or not --- devenv/src/devenv.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/devenv/src/devenv.rs b/devenv/src/devenv.rs index c7fcb8cb5..79fda0e4a 100644 --- a/devenv/src/devenv.rs +++ b/devenv/src/devenv.rs @@ -332,16 +332,16 @@ impl Devenv { let copy_script = ©_script[0]; let copy_script_string = ©_script.to_string_lossy(); - let copy_args = [ - spec, - registry.unwrap_or("false").to_string(), - copy_args.join(" "), - ]; + let base_args = [spec, registry.unwrap_or("false").to_string()]; + let command_args: Vec = base_args + .into_iter() + .chain(copy_args.iter().map(|s| s.to_string())) + .collect(); - info!("Running {copy_script_string} {}", copy_args.join(" ")); + info!("Running {copy_script_string} {}", command_args.join(" ")); let status = std::process::Command::new(copy_script) - .args(copy_args) + .args(command_args) .stdout(std::process::Stdio::inherit()) .stderr(std::process::Stdio::inherit()) .status() From 7847d8c5f7df24ff80dbd07f34d4610943b35563 Mon Sep 17 00:00:00 2001 From: ento Date: Thu, 26 Dec 2024 11:28:40 -0800 Subject: [PATCH 2/2] containers: wrap extra args in quotes --- src/modules/containers.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/containers.nix b/src/modules/containers.nix index 736a71025..e181b2c16 100644 --- a/src/modules/containers.nix +++ b/src/modules/containers.nix @@ -182,7 +182,7 @@ let echo "Copying container $container to $dest" echo - ${nix2container.skopeo-nix2container}/bin/skopeo --insecure-policy copy "nix:$container" "$dest" ''${args[@]} + ${nix2container.skopeo-nix2container}/bin/skopeo --insecure-policy copy "nix:$container" "$dest" "''${args[@]}" ''; containerOptions = types.submodule ({ name, config, ... }: { options = {