nixos/zfs: remove incorrect conditional use of spl kmod

This was incorrectly getting `lib.version` which is e.g.
`"24.11pre-git"`, but should have been the ZFS package version. However,
the condition, at least per the comment, is reversed and should be
instead `versionOlder cfgZfs.package.version "2.2.0"`. However, the
entire premise seems to be incorrect, as ZFS 2.2.6 includes the spl
module. Since the previous condition here was effectively always true,
it would initially seem the best move is to remove the conditional
altogether and always include the spl kmod. However, going back to
4360a87c45 where this condition was added,
the intent appears to be that spl was no longer needed here in
the-pre-release ZFS (long since in all supported versions), due to it
being merged into ZFS mainline. Given that intent and that our boot
tests on all versions succeed without including it in the initrd, remove
it.
This commit is contained in:
Andrew Marshall 2024-09-24 14:17:42 -04:00
parent 30439d93eb
commit 06ed2c46fb

View File

@ -592,8 +592,7 @@ in
};
boot.initrd = mkIf inInitrd {
# spl has been removed in ≥ 2.2.0.
kernelModules = [ "zfs" ] ++ lib.optional (lib.versionOlder "2.2.0" version) "spl";
kernelModules = [ "zfs" ];
extraUtilsCommands =
mkIf (!config.boot.initrd.systemd.enable) ''
copy_bin_and_libs ${cfgZfs.package}/sbin/zfs