I’m looking to try and run zfs with an older kernel, namely the 5.15. As context there is an issue with 6.X series kernels and vfio with newer am5 platforms. I verified this by testing my configuration on Rocky Linux 9 5.15 and it worked, with nix it didn’t.
I can’t seem to find a way to override the zfs package and corresponding kernel. Setting to the linux package for 5_15 resulted in an error.
> created 19 symlinks in user environment
> inconsistent kernel versions: 5.15.117
> 6.1.34
I’m still not well versed in custom nix packaging. So may be missing a simple option. Is there a way to provide a custom kernel without having to port the entire zfs configuration module?
The fact that the zfs package exposes its latest compatible kernel seems to have gotten you confused. You shouldn’t need to touch anything related to zfs
The inconsistent kernel versions error seems to result from an attempt to override just the zfs module.
Instead replace the kernel (or: kernelPackages). It’s in the NixOS manual.
error: builder for '/nix/store/6hvdx2p82iikirajdv0c357ggppvyzsd-kernel-modules.drv' failed with exit code 1;
last 3 log lines:
> created 19 symlinks in user environment
> inconsistent kernel versions: 5.15.119
> 6.3.11
For full logs, run 'nix log /nix/store/6hvdx2p82iikirajdv0c357ggppvyzsd-kernel-modules.drv'.
error: 1 dependencies of derivation '/nix/store/8n21bvbhpni23fn8a256570zm4dnzqsn-nixos-system-workstation-23.05.20230705.e111420.drv' failed to build
make: *** [Makefile:24: system-build] Error 1
It looked like any of the boot.zfs pulls in zfs stable? Which does that kernel version check. Which potentially I have to switch root fs off of zfs?
Shouldn’t happen. Certainly not based on the snippets you’ve provided.
It’s just used to determine the latest compatible version.
Just to confirm: I put my own suggestion in my configuration.nix and rebuilt a 5.15 kernel with zfs without issue. Note the inconsistent kernel versions error could be caused by any module - it doesn’t have to be zfs.
There must be something else to your config - can you share the full/more of your configuration.nix?