diff --git a/src/nixos-anywhere.sh b/src/nixos-anywhere.sh index 7124b852..19ccee91 100755 --- a/src/nixos-anywhere.sh +++ b/src/nixos-anywhere.sh @@ -123,6 +123,8 @@ step() { } parseArgs() { + local substituteOnDestination=y + local printBuildLogs=n while [[ $# -gt 0 ]]; do case "$1" in -f | --flake) @@ -226,7 +228,7 @@ parseArgs() { nixOptions+=("--option" "$key" "$value") ;; --no-substitute-on-destination) - nixCopyOptions+=("--substitute-on-destination") + substituteOnDestination=n ;; --build-on-remote) buildOnRemote=y @@ -249,10 +251,14 @@ parseArgs() { shift done - if [[ ${printBuildLogs-n} == "y" ]]; then + if [[ ${printBuildLogs} == "y" ]]; then 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