From c928f74206c2242b81b63eb49f1a1bef04105e04 Mon Sep 17 00:00:00 2001 From: Bryan Richter Date: Tue, 17 Sep 2024 15:11:46 +0300 Subject: [PATCH 1/2] Re-invert behavior of --no-substitute-on-destination Accidentally inverted in 763732541f3a7579ed5d6ab2111f2c1ab620d915 --- src/nixos-anywhere.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nixos-anywhere.sh b/src/nixos-anywhere.sh index 7124b852..363a2282 100755 --- a/src/nixos-anywhere.sh +++ b/src/nixos-anywhere.sh @@ -123,6 +123,7 @@ step() { } parseArgs() { + local substituteOnDestination=y while [[ $# -gt 0 ]]; do case "$1" in -f | --flake) @@ -226,7 +227,7 @@ parseArgs() { nixOptions+=("--option" "$key" "$value") ;; --no-substitute-on-destination) - nixCopyOptions+=("--substitute-on-destination") + substituteOnDestination=n ;; --build-on-remote) buildOnRemote=y @@ -253,6 +254,10 @@ parseArgs() { nixOptions+=("-L") fi + if [[ $substituteOnDestination == "y" ]]; then + nixCopyOptions+=("--substitute-on-destination") + fi + if [[ $vmTest == "n" ]] && [[ -z ${sshConnection} ]]; then abort "ssh-host must be set" fi From 95efb19b0b96c6c808520495652e81c2c8c24a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 18 Sep 2024 16:28:17 +0200 Subject: [PATCH 2/2] make printBuildLogs a local variable --- src/nixos-anywhere.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nixos-anywhere.sh b/src/nixos-anywhere.sh index 363a2282..19ccee91 100755 --- a/src/nixos-anywhere.sh +++ b/src/nixos-anywhere.sh @@ -124,6 +124,7 @@ step() { parseArgs() { local substituteOnDestination=y + local printBuildLogs=n while [[ $# -gt 0 ]]; do case "$1" in -f | --flake) @@ -250,7 +251,7 @@ parseArgs() { shift done - if [[ ${printBuildLogs-n} == "y" ]]; then + if [[ ${printBuildLogs} == "y" ]]; then nixOptions+=("-L") fi