Skip to content

Commit

Permalink
make ssh host optional again in vm-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Sep 16, 2024
1 parent a422dbd commit 4601bf9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/nixos-anywhere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ enableDebug=""
diskoScript=""
nixosSystem=""
extraFiles=""
vmTest="n"
nixOptions=(
--extra-experimental-features 'nix-command flakes'
"--no-write-lock-file"
Expand Down Expand Up @@ -240,7 +241,7 @@ parseArgs() {
nixCopyOptions+=("--substitute-on-destination")
fi

if [[ -z ${sshConnection-} ]]; then
if [[ $vmTest == "n" ]] && [[ -z ${sshConnection-} ]]; then
abort "ssh-host must be set"
fi

Expand Down Expand Up @@ -299,7 +300,7 @@ runVmTest() {
echo "--vm-test is not supported with --disk-encryption-keys" >&2
exit 1
fi
exec nix build \
nix build \
--print-out-paths \
--no-link \
-L \
Expand Down Expand Up @@ -510,8 +511,9 @@ SSH
main() {
parseArgs "$@"

if [[ -n ${vmTest-} ]]; then
if [[ -n ${vmTest} ]]; then
runVmTest
exit 0
fi

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

0 comments on commit 4601bf9

Please sign in to comment.