@@ -378,12 +378,14 @@ mountFS() {
378378
379379 mkdir -p "/mnt-root$mountPoint"
380380
381− # For CIFS mounts, retry a few times before giving up.
381+ # For ZFS and CIFS mounts, retry a few times before giving up.
382+ # We do this for ZFS as a workaround for issue NixOS/nixpkgs#25383.
382383 local n=0
383384 while true; do
384385 mount "/mnt-root$mountPoint" && break
385− if [ "$fsType" != cifs -o "$n" -ge 10 ]; then fail; break; fi
386+ if [ \( "$fsType" != cifs -a "$fsType" != zfs \) -o "$n" -ge 10 ]; then fail; break; fi
386387 echo "retrying..."
388+ sleep 1
387389 n=$((n + 1))
388390 done
389391