nixos/bcachefs: soft-deprecate 'linuxPackages_testing_bcachefs'

'bcachefs' is included in the linux kernel since 6.7-rc1

Madoura 890cf0a7 0adbda28

+29 -3
+26 -3
nixos/modules/tasks/filesystems/bcachefs.nix
··· 88 }; 89 }; 90 91 in 92 93 { 94 config = lib.mkIf (lib.elem "bcachefs" config.boot.supportedFilesystems) (lib.mkMerge [ 95 { 96 # needed for systemd-remount-fs 97 system.fsPackages = [ pkgs.bcachefs-tools ]; 98 99 - # use kernel package with bcachefs support until it's in mainline 100 - # TODO replace with requireKernelConfig 101 - boot.kernelPackages = pkgs.linuxPackages_testing_bcachefs; 102 103 systemd.services = lib.mapAttrs' (mkUnits "") (lib.filterAttrs (n: fs: (fs.fsType == "bcachefs") && (!utils.fsNeededForBoot fs)) config.fileSystems); 104 } 105 106 (lib.mkIf ((lib.elem "bcachefs" config.boot.initrd.supportedFilesystems) || (bootFs != {})) { 107 # chacha20 and poly1305 are required only for decryption attempts 108 boot.initrd.availableKernelModules = [ "bcachefs" "sha256" "chacha20" "poly1305" ]; 109 boot.initrd.systemd.extraBin = {
··· 88 }; 89 }; 90 91 + assertions = [ 92 + { 93 + assertion = let 94 + kernel = config.boot.kernelPackages.kernel; 95 + in ( 96 + kernel.kernelAtLeast "6.7" || ( 97 + lib.elem (kernel.structuredExtraConfig.BCACHEFS_FS or null) [ 98 + lib.kernel.module 99 + lib.kernel.yes 100 + lib.kernel.option.yes 101 + ] 102 + ) 103 + ); 104 + 105 + message = "Linux 6.7-rc1 at minimum or a custom linux kernel with bcachefs support is required"; 106 + } 107 + ]; 108 in 109 110 { 111 config = lib.mkIf (lib.elem "bcachefs" config.boot.supportedFilesystems) (lib.mkMerge [ 112 { 113 + inherit assertions; 114 # needed for systemd-remount-fs 115 system.fsPackages = [ pkgs.bcachefs-tools ]; 116 117 + # FIXME: Replace this with `linuxPackages_testing` after NixOS 23.11 is released 118 + # FIXME: Replace this with `linuxPackages_latest` when 6.7 is released, remove this line when the LTS version is at least 6.7 119 + boot.kernelPackages = lib.mkDefault ( 120 + # FIXME: Remove warning after NixOS 23.11 is released 121 + 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" 122 + pkgs.linuxPackages_testing_bcachefs 123 + ); 124 125 systemd.services = lib.mapAttrs' (mkUnits "") (lib.filterAttrs (n: fs: (fs.fsType == "bcachefs") && (!utils.fsNeededForBoot fs)) config.fileSystems); 126 } 127 128 (lib.mkIf ((lib.elem "bcachefs" config.boot.initrd.supportedFilesystems) || (bootFs != {})) { 129 + inherit assertions; 130 # chacha20 and poly1305 are required only for decryption attempts 131 boot.initrd.availableKernelModules = [ "bcachefs" "sha256" "chacha20" "poly1305" ]; 132 boot.initrd.systemd.extraBin = {
+1
pkgs/top-level/all-packages.nix
··· 28107 linuxPackages_testing = linuxKernel.packages.linux_testing; 28108 linux_testing = linuxKernel.kernels.linux_testing; 28109 28110 linuxPackages_testing_bcachefs = linuxKernel.packages.linux_testing_bcachefs; 28111 linux_testing_bcachefs = linuxKernel.kernels.linux_testing_bcachefs; 28112
··· 28107 linuxPackages_testing = linuxKernel.packages.linux_testing; 28108 linux_testing = linuxKernel.kernels.linux_testing; 28109 28110 + # FIXME: Remove and alias to `linux(Packages)_testing`` after 23.11 is released 28111 linuxPackages_testing_bcachefs = linuxKernel.packages.linux_testing_bcachefs; 28112 linux_testing_bcachefs = linuxKernel.kernels.linux_testing_bcachefs; 28113
+2
pkgs/top-level/linux-kernels.nix
··· 201 then latest 202 else testing; 203 204 linux_testing_bcachefs = callPackage ../os-specific/linux/kernel/linux-testing-bcachefs.nix { 205 # Pinned on the last version which Kent's commits can be cleany rebased up. 206 kernel = linux_6_5; ··· 612 613 # Intentionally lacks recurseIntoAttrs, as -rc kernels will quite likely break out-of-tree modules and cause failed Hydra builds. 614 linux_testing = packagesFor kernels.linux_testing; 615 linux_testing_bcachefs = recurseIntoAttrs (packagesFor kernels.linux_testing_bcachefs); 616 617 linux_hardened = recurseIntoAttrs (packagesFor kernels.linux_hardened);
··· 201 then latest 202 else testing; 203 204 + # FIXME: Remove after 23.11 is released 205 linux_testing_bcachefs = callPackage ../os-specific/linux/kernel/linux-testing-bcachefs.nix { 206 # Pinned on the last version which Kent's commits can be cleany rebased up. 207 kernel = linux_6_5; ··· 613 614 # Intentionally lacks recurseIntoAttrs, as -rc kernels will quite likely break out-of-tree modules and cause failed Hydra builds. 615 linux_testing = packagesFor kernels.linux_testing; 616 + # FIXME: Remove after 23.11 is released 617 linux_testing_bcachefs = recurseIntoAttrs (packagesFor kernels.linux_testing_bcachefs); 618 619 linux_hardened = recurseIntoAttrs (packagesFor kernels.linux_hardened);