From fae5ee8a47ac3b237d4fdd2f5cb85129c7af9045 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Sat, 25 Apr 2026 00:43:08 -0400 Subject: [PATCH] zfs: fix patch inclusion --- modules/zfs.nix | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/modules/zfs.nix b/modules/zfs.nix index 4ed5e9b..a3d8f69 100644 --- a/modules/zfs.nix +++ b/modules/zfs.nix @@ -20,14 +20,24 @@ let arcMaxBytes = (totalRamBytes - totalHugepageBytes) * 60 / 100; in { - # remove inline dbuf_evict_one call so the dedicated eviction thread - # handles cache pressure instead of stalling txg_sync on 6.14+. + # Patch ZFS via overlay so both userspace and kernel module are patched. + # boot.zfs.package alone only affects userspace; the kernel module is + # resolved via boot.kernelPackages.${pkgs.zfs.kernelModuleAttribute}. # https://github.com/openzfs/zfs/issues/18426 - boot.zfs.package = pkgs.zfs_2_4.overrideAttrs (old: { - patches = (old.patches or [ ]) ++ [ - ../patches/zfs/0001-remove-dbuf_evict_one-call.patch - ]; - }); + nixpkgs.overlays = [ + (final: prev: { + zfs_2_3 = prev.zfs_2_3.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ + ../patches/zfs/0001-remove-dbuf_evict_one-call.patch + ]; + }); + zfs_2_4 = prev.zfs_2_4.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ + ../patches/zfs/0001-remove-dbuf_evict_one-call.patch + ]; + }); + }) + ]; boot.initrd.kernelModules = [ "zfs" ]; boot.kernelParams = [