From a86402e1850769fa1a6ab4b6b090f8e9cd92ccbe Mon Sep 17 00:00:00 2001 From: Bryan Richter Date: Tue, 17 Sep 2024 15:11:46 +0300 Subject: [PATCH] Re-invert behavior of --no-substitute-on-destination Accidentally inverted in 763732541f3a7579ed5d6ab2111f2c1ab620d915 --- src/nixos-anywhere.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nixos-anywhere.sh b/src/nixos-anywhere.sh index 7124b852..a4134bd8 100755 --- a/src/nixos-anywhere.sh +++ b/src/nixos-anywhere.sh @@ -53,7 +53,9 @@ trap 'rm -rf "$sshKeyDir"' EXIT mkdir -p "$sshKeyDir" declare -A diskEncryptionKeys=() -declare -a nixCopyOptions=() +# Option '--no-substitute-on-destination' relies on this being initialized in +# this way. +declare -a nixCopyOptions=("--substitute-on-destination") declare -a sshArgs=() showUsage() { @@ -226,7 +228,9 @@ parseArgs() { nixOptions+=("--option" "$key" "$value") ;; --no-substitute-on-destination) - nixCopyOptions+=("--substitute-on-destination") + # "--substitute-on-destination" is the first element, assigned at + # initalization + unset "nixCopyOptions[0]" ;; --build-on-remote) buildOnRemote=y