From 06ed2c46fb92ef241c90e374cd10782690ec3b8d Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 24 Sep 2024 14:17:42 -0400 Subject: [PATCH] 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 4360a87c45f69f7444c7b87546705de7fbc8681f 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. --- nixos/modules/tasks/filesystems/zfs.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index 1bcfd6ccba93..294e2e100ef4 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -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