Skip to content

Commit edf1adb

Browse files
authored
Merge pull request #507 from nix-community/disko-mode
Error if --disko-mode and --store-paths are both set
2 parents 7367342 + be969b0 commit edf1adb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/nixos-anywhere.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enableDebug=""
1111
nixBuildFlags=()
1212
diskoAttr=""
1313
diskoScript=""
14-
diskoMode="disko"
14+
diskoMode=""
1515
diskoDeps=y
1616
nixosSystem=""
1717
extraFiles=""
@@ -358,6 +358,14 @@ parseArgs() {
358358

359359
diskoAttr="${diskoMode}Script"
360360

361+
if [[ ${diskoMode} != "" ]]; then
362+
if [[ ${diskoScript} != "" ]]; then
363+
abort "--disko-mode cannot be used if --store-paths is used"
364+
fi
365+
else
366+
diskoMode=disko
367+
fi
368+
361369
if [[ ${diskoDeps} == "n" ]]; then
362370
diskoAttr="${diskoAttr}NoDeps"
363371
fi
@@ -745,7 +753,7 @@ if [ ! -z ${NIXOS_NO_CHECK+0} ]; then
745753
export NIXOS_NO_CHECK
746754
fi
747755
nixos-install --no-root-passwd --no-channel-copy --system "$nixosSystem"
748-
if [[ ${phases[reboot]} == 1 ]]; then
756+
if [ ${phases[reboot]} == 1 ]; then
749757
if command -v zpool >/dev/null && [ "\$(zpool list)" != "no pools available" ]; then
750758
# we always want to export the zfs pools so people can boot from it without force import
751759
umount -Rv /mnt/

0 commit comments

Comments
 (0)