Skip to content

Commit 11d3803

Browse files
authored
Merge pull request #160 from numtide/zfs-optional
skip zpool command if we don't have it installed
2 parents c40492c + a9e9b70 commit 11d3803

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/nixos-anywhere.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,9 @@ export PATH=\$PATH:/run/current-system/sw/bin
423423
mkdir -p /mnt/tmp
424424
chmod 777 /mnt/tmp
425425
nixos-install --no-root-passwd --no-channel-copy --system "$nixos_system"
426-
zpool export -a || : # we always want to export the zfs pools so people can boot from it without force import
426+
if command -v zpool >/dev/null; then
427+
zpool export -a || : # we always want to export the zfs pools so people can boot from it without force import
428+
fi
427429
# We will reboot in background so we can cleanly finish the script before the hosts go down.
428430
# This makes integration into scripts easier
429431
nohup bash -c '${maybe_reboot}' >/dev/null &

0 commit comments

Comments
 (0)