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";