From 3a69ec5f156ead261e57a377fb03e105e9a6fe0c Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Sat, 21 Jun 2025 15:05:39 -0400 Subject: [PATCH] nixos/bcachefs: include poly1305 and chacha20 kernel modules for kernel < 6.15 Kernel 6.16-rc1 removed the poly1305 algorithm in ceef731b0e22df80a13d67773ae9afd55a971f9e bcachefs switched to the kernel libraries for poly1305 and chacha20 in 6.15 in 4bf4b5046de0ef7f9dc50f3a9ef8a6dcda178a6d (cherry picked from commit f9bd91aa07c30359540aeec8613a29f0b742f540) --- nixos/modules/tasks/filesystems/bcachefs.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/nixos/modules/tasks/filesystems/bcachefs.nix b/nixos/modules/tasks/filesystems/bcachefs.nix index a3d0e9463832..1570cf1a6860 100644 --- a/nixos/modules/tasks/filesystems/bcachefs.nix +++ b/nixos/modules/tasks/filesystems/bcachefs.nix @@ -179,13 +179,18 @@ in (lib.mkIf ((config.boot.initrd.supportedFilesystems.bcachefs or false) || (bootFs != { })) { inherit assertions; - # chacha20 and poly1305 are required only for decryption attempts - boot.initrd.availableKernelModules = [ - "bcachefs" - "sha256" - "chacha20" - "poly1305" - ]; + boot.initrd.availableKernelModules = + [ + "bcachefs" + "sha256" + ] + ++ lib.optionals (config.boot.kernelPackages.kernel.kernelOlder "6.15") [ + # chacha20 and poly1305 are required only for decryption attempts + # kernel 6.15 uses kernel api libraries for poly1305/chacha20: 4bf4b5046de0ef7f9dc50f3a9ef8a6dcda178a6d + # kernel 6.16 removes poly1305: ceef731b0e22df80a13d67773ae9afd55a971f9e + "poly1305" + "chacha20" + ]; boot.initrd.systemd.extraBin = { # do we need this? boot/systemd.nix:566 & boot/systemd/initrd.nix:357 "bcachefs" = "${pkgs.bcachefs-tools}/bin/bcachefs";