ZFS kernel module not available?

I’m trying to mount some disks to a non zfs system and I went ahead and added


boot.zfs.extraPools = [ "diska" "diskb" ];
services.zfs.autoScrub.enable = true;
boot.zfs.forceImportRoot = false;
services.zfs.trim.enable = true;
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;

But attempting to get to them with zfs tools results in

❯ zfs list
The ZFS modules are not loaded.
Try running '/sbin/modprobe zfs' as root to load them.

and trying to load the module results in it not being found

❯ sudo modprobe zfs
modprobe: FATAL: Module zfs not found in directory /run/booted-system/kernel-modules/lib/modules/6.5.7

Has anyone run into this?

Can you try putting

boot.supportedFilesystems = [ "zfs" ];

in your config and see if that fixes it?

That seems to have fixed it, should that be added to ZFS - NixOS Wiki ?

Thanks a ton btw, I was banging my head against the wall for a few hours trying to figure this out.

It probably should.

Nicely enough, openzfs has their own guide: NixOS — OpenZFS documentation