@@ -255,7 +255,7 @@ nixBuild() {
255
255
}
256
256
257
257
runVmTest () {
258
- if [[ -n ${diskoScript-} ]] && [[ -n ${nixosSystem -} ]]; then
258
+ if [[ -z ${flakeAttr -} ]]; then
259
259
echo " --vm-test is not supported with --store-paths" >&2
260
260
echo " Please use --flake instead or build config.system.build.installTest of your nixos configuration manually" >&2
261
261
exit 1
@@ -286,7 +286,6 @@ if [[ -z ${sshConnection-} ]]; then
286
286
abort " ssh-host must be set"
287
287
fi
288
288
289
- # parse flake nixos-install style syntax, get the system attr
290
289
if [[ -n ${flake-} ]]; then
291
290
if [[ $flake =~ ^(.* )\# ([^\#\" ]* )$ ]]; then
292
291
flake=" ${BASH_REMATCH[1]} "
@@ -297,9 +296,14 @@ if [[ -n ${flake-} ]]; then
297
296
echo ' For example, to use the output nixosConfigurations.foo from the flake.nix, append "#foo" to the flake-uri.' >&2
298
297
exit 1
299
298
fi
300
- if [[ -n $vmTest ]]; then
301
- runVmTest
302
- fi
299
+ fi
300
+
301
+ if [[ -n ${vmTest-} ]]; then
302
+ runVmTest
303
+ fi
304
+
305
+ # parse flake nixos-install style syntax, get the system attr
306
+ if [[ -n ${flake-} ]]; then
303
307
if [[ ${buildOnRemote} == " n" ]]; then
304
308
diskoScript=$( nixBuild " ${flake} #nixosConfigurations.\" ${flakeAttr} \" .config.system.build.diskoScript" )
305
309
nixosSystem=$( nixBuild " ${flake} #nixosConfigurations.\" ${flakeAttr} \" .config.system.build.toplevel" )
@@ -309,7 +313,7 @@ elif [[ -n ${diskoScript-} ]] && [[ -n ${nixosSystem-} ]]; then
309
313
abort " ${diskoScript} and ${nixosSystem} must be existing store-paths"
310
314
fi
311
315
else
312
- abort " flake must be set"
316
+ abort " -- flake or --store-paths must be set"
313
317
fi
314
318
315
319
if [[ -n ${SSH_PRIVATE_KEY} ]] && [[ -z ${sshPrivateKeyFile-} ]]; then
0 commit comments