Skip to content

Commit 4601bf9

Browse files
committed
make ssh host optional again in vm-test
1 parent a422dbd commit 4601bf9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/nixos-anywhere.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ enableDebug=""
88
diskoScript=""
99
nixosSystem=""
1010
extraFiles=""
11+
vmTest="n"
1112
nixOptions=(
1213
--extra-experimental-features 'nix-command flakes'
1314
"--no-write-lock-file"
@@ -240,7 +241,7 @@ parseArgs() {
240241
nixCopyOptions+=("--substitute-on-destination")
241242
fi
242243

243-
if [[ -z ${sshConnection-} ]]; then
244+
if [[ $vmTest == "n" ]] && [[ -z ${sshConnection-} ]]; then
244245
abort "ssh-host must be set"
245246
fi
246247

@@ -299,7 +300,7 @@ runVmTest() {
299300
echo "--vm-test is not supported with --disk-encryption-keys" >&2
300301
exit 1
301302
fi
302-
exec nix build \
303+
nix build \
303304
--print-out-paths \
304305
--no-link \
305306
-L \
@@ -510,8 +511,9 @@ SSH
510511
main() {
511512
parseArgs "$@"
512513

513-
if [[ -n ${vmTest-} ]]; then
514+
if [[ -n ${vmTest} ]]; then
514515
runVmTest
516+
exit 0
515517
fi
516518

517519
# parse flake nixos-install style syntax, get the system attr

0 commit comments

Comments
 (0)