Troubles with ZFS and debugging a systemd service

The difference between fileSystems vs extraPools shouldn’t cause the import to fail like you were seeing, so I’m rather surprised that made any difference. That said, a subsequent issue would have been that having a fileSystems entry for a non-legacy ZFS dataset can lead to confusing race conditions with zfs-mount.service (which mounts ZFS datasets with mountpoint=/a/path, which is the default mountpoint). Basically, nixos sees any fileSystems entries that have fsType = "zfs";, and generates a systemd service to import the pool along with lines in /etc/fstab to mount the datasets. For extraPools it just creates the import service. The import service should be fine (but this is the part you were seeing errors with), but then fstab and zfs-mount.service would have a race condition on actually mounting datasets in the right order.

This is one of a few caveats with ZFS that I should really add to the nixos wiki page…