Skip to content

Commit c699182

Browse files
authored
Merge pull request #472 from a-kenji/gate-nixos-system
only build NixOS if you have the install phase enabled
2 parents e8e5d63 + 1800547 commit c699182

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/nixos-anywhere.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,9 @@ main() {
726726
if [[ ${phases[disko]} == 1 ]]; then
727727
diskoScript=$(nixBuild "${flake}#${flakeAttr}.system.build.${diskoMode}Script")
728728
fi
729-
nixosSystem=$(nixBuild "${flake}#${flakeAttr}.system.build.toplevel")
729+
if [[ ${phases[install]} == 1 ]]; then
730+
nixosSystem=$(nixBuild "${flake}#${flakeAttr}.system.build.toplevel")
731+
fi
730732
fi
731733
elif [[ -n ${diskoScript} ]] && [[ -n ${nixosSystem} ]]; then
732734
if [[ ! -e ${diskoScript} ]] || [[ ! -e ${nixosSystem} ]]; then
@@ -799,7 +801,9 @@ main() {
799801
if [[ ${phases[disko]} == 1 ]]; then
800802
diskoScript=$(nixBuild "${flake}#${flakeAttr}.system.build.${diskoMode}Script")
801803
fi
802-
nixosSystem=$(nixBuild "${flake}#${flakeAttr}.system.build.toplevel")
804+
if [[ ${phases[install]} == 1 ]]; then
805+
nixosSystem=$(nixBuild "${flake}#${flakeAttr}.system.build.toplevel")
806+
fi
803807
fi
804808
805809
# Installation will fail if non-root user is used for installer.

0 commit comments

Comments
 (0)