From cbd09c66a594f62566d2f4fbfaf2d1297cecc0fb Mon Sep 17 00:00:00 2001 From: okt Date: Tue, 23 Dec 2025 10:57:10 -0700 Subject: [PATCH] nixos/btrfs: use algorithm names instead of kernel module names The canonical names of kernel crypto modules are not stable across versions. Use the algorithm names from btrfs softdeps instead, which the kernel will resolve to the appropriate modules. Previously: xxhash_generic, blake2b_generic, sha256_generic Now: xxhash64, blake2b-256, sha256 This fixes initrd builds on kernel 6.19+ where blake2b_generic was renamed to blake2b, and is more resilient to future module renames. See: https://github.com/torvalds/linux/blob/v6.19-rc1/fs/btrfs/super.c#L2705-L2708 --- nixos/modules/tasks/filesystems/btrfs.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nixos/modules/tasks/filesystems/btrfs.nix b/nixos/modules/tasks/filesystems/btrfs.nix index 9d3039fccbfb..1cff79f887b6 100644 --- a/nixos/modules/tasks/filesystems/btrfs.nix +++ b/nixos/modules/tasks/filesystems/btrfs.nix @@ -89,12 +89,11 @@ in "crc32c" ] ++ optionals (config.boot.kernelPackages.kernel.kernelAtLeast "5.5") [ - # Needed for mounting filesystems with new checksums - "xxhash_generic" - "blake2b_generic" - - # `sha256` is always available, whereas `sha256_generic` is not available from 6.17 onwards + # The canonical names of these modules are not very stable, so use the algorithm names that the btrfs module expects. + # See: https://github.com/torvalds/linux/blob/v6.19-rc1/fs/btrfs/super.c#L2705-L2708 + "xxhash64" "sha256" # Should be baked into our kernel, just to be sure + "blake2b-256" ]; boot.initrd.extraUtilsCommands = mkIf (!config.boot.initrd.systemd.enable) ''