···8888 };
8989 };
90909191+ assertions = [
9292+ {
9393+ assertion = let
9494+ kernel = config.boot.kernelPackages.kernel;
9595+ in (
9696+ kernel.kernelAtLeast "6.7" || (
9797+ lib.elem (kernel.structuredExtraConfig.BCACHEFS_FS or null) [
9898+ lib.kernel.module
9999+ lib.kernel.yes
100100+ lib.kernel.option.yes
101101+ ]
102102+ )
103103+ );
104104+105105+ message = "Linux 6.7-rc1 at minimum or a custom linux kernel with bcachefs support is required";
106106+ }
107107+ ];
91108in
9210993110{
94111 config = lib.mkIf (lib.elem "bcachefs" config.boot.supportedFilesystems) (lib.mkMerge [
95112 {
113113+ inherit assertions;
96114 # needed for systemd-remount-fs
97115 system.fsPackages = [ pkgs.bcachefs-tools ];
981169999- # use kernel package with bcachefs support until it's in mainline
100100- # TODO replace with requireKernelConfig
101101- boot.kernelPackages = pkgs.linuxPackages_testing_bcachefs;
117117+ # FIXME: Replace this with `linuxPackages_testing` after NixOS 23.11 is released
118118+ # FIXME: Replace this with `linuxPackages_latest` when 6.7 is released, remove this line when the LTS version is at least 6.7
119119+ boot.kernelPackages = lib.mkDefault (
120120+ # FIXME: Remove warning after NixOS 23.11 is released
121121+ lib.warn "Please upgrade to Linux 6.7-rc1 or later: 'linuxPackages_testing_bcachefs' is deprecated. Use 'boot.kernelPackages = pkgs.linuxPackages_testing;' to silence this warning"
122122+ pkgs.linuxPackages_testing_bcachefs
123123+ );
102124103125 systemd.services = lib.mapAttrs' (mkUnits "") (lib.filterAttrs (n: fs: (fs.fsType == "bcachefs") && (!utils.fsNeededForBoot fs)) config.fileSystems);
104126 }
105127106128 (lib.mkIf ((lib.elem "bcachefs" config.boot.initrd.supportedFilesystems) || (bootFs != {})) {
129129+ inherit assertions;
107130 # chacha20 and poly1305 are required only for decryption attempts
108131 boot.initrd.availableKernelModules = [ "bcachefs" "sha256" "chacha20" "poly1305" ];
109132 boot.initrd.systemd.extraBin = {
+1
pkgs/top-level/all-packages.nix
···2810728107 linuxPackages_testing = linuxKernel.packages.linux_testing;
2810828108 linux_testing = linuxKernel.kernels.linux_testing;
28109281092811028110+ # FIXME: Remove and alias to `linux(Packages)_testing`` after 23.11 is released
2811028111 linuxPackages_testing_bcachefs = linuxKernel.packages.linux_testing_bcachefs;
2811128112 linux_testing_bcachefs = linuxKernel.kernels.linux_testing_bcachefs;
2811228113
+2
pkgs/top-level/linux-kernels.nix
···201201 then latest
202202 else testing;
203203204204+ # FIXME: Remove after 23.11 is released
204205 linux_testing_bcachefs = callPackage ../os-specific/linux/kernel/linux-testing-bcachefs.nix {
205206 # Pinned on the last version which Kent's commits can be cleany rebased up.
206207 kernel = linux_6_5;
···612613613614 # Intentionally lacks recurseIntoAttrs, as -rc kernels will quite likely break out-of-tree modules and cause failed Hydra builds.
614615 linux_testing = packagesFor kernels.linux_testing;
616616+ # FIXME: Remove after 23.11 is released
615617 linux_testing_bcachefs = recurseIntoAttrs (packagesFor kernels.linux_testing_bcachefs);
616618617619 linux_hardened = recurseIntoAttrs (packagesFor kernels.linux_hardened);