···30303131[`sudo-rs`]: https://github.com/memorysafety/sudo-rs/
32323333+- `linuxPackages_testing_bcachefs` is now soft-deprecated by `linuxPackages_testing`.
3434+ - Please consider changing your NixOS configuration's `boot.kernelPackages` to `linuxPackages_testing` until a stable kernel with bcachefs support is released.
3535+3336- All [ROCm](https://rocm.docs.amd.com/en/latest/) packages have been updated to 5.7.0.
3437 - [ROCm](https://rocm.docs.amd.com/en/latest/) package attribute sets are versioned: `rocmPackages` -> `rocmPackages_5`.
3538
+31-10
nixos/modules/tasks/filesystems/bcachefs.nix
···11{ config, lib, pkgs, utils, ... }:
2233-with lib;
44-53let
6477- bootFs = filterAttrs (n: fs: (fs.fsType == "bcachefs") && (utils.fsNeededForBoot fs)) config.fileSystems;
55+ bootFs = lib.filterAttrs (n: fs: (fs.fsType == "bcachefs") && (utils.fsNeededForBoot fs)) config.fileSystems;
8697 commonFunctions = ''
108 prompt() {
···5654 # remove this adaptation when bcachefs implements mounting by filesystem uuid
5755 # also, implement automatic waiting for the constituent devices when that happens
5856 # bcachefs does not support mounting devices with colons in the path, ergo we don't (see #49671)
5959- firstDevice = fs: head (splitString ":" fs.device);
5757+ firstDevice = fs: lib.head (lib.splitString ":" fs.device);
60586159 openCommand = name: fs: ''
6260 tryUnlock ${name} ${firstDevice fs}
···9088 };
9189 };
92909191+ 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+ ];
93108in
9410995110{
9696- config = mkIf (elem "bcachefs" config.boot.supportedFilesystems) (mkMerge [
111111+ config = lib.mkIf (lib.elem "bcachefs" config.boot.supportedFilesystems) (lib.mkMerge [
97112 {
113113+ inherit assertions;
98114 # needed for systemd-remount-fs
99115 system.fsPackages = [ pkgs.bcachefs-tools ];
100116101101- # use kernel package with bcachefs support until it's in mainline
102102- # TODO replace with requireKernelConfig
103103- 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+ );
104124105125 systemd.services = lib.mapAttrs' (mkUnits "") (lib.filterAttrs (n: fs: (fs.fsType == "bcachefs") && (!utils.fsNeededForBoot fs)) config.fileSystems);
106126 }
107127108108- (mkIf ((elem "bcachefs" config.boot.initrd.supportedFilesystems) || (bootFs != {})) {
128128+ (lib.mkIf ((lib.elem "bcachefs" config.boot.initrd.supportedFilesystems) || (bootFs != {})) {
129129+ inherit assertions;
109130 # chacha20 and poly1305 are required only for decryption attempts
110131 boot.initrd.availableKernelModules = [ "bcachefs" "sha256" "chacha20" "poly1305" ];
111132 boot.initrd.systemd.extraBin = {
···121142 $out/bin/bcachefs version
122143 '';
123144124124- boot.initrd.postDeviceCommands = lib.mkIf (!config.boot.initrd.systemd.enable) (commonFunctions + concatStrings (mapAttrsToList openCommand bootFs));
145145+ boot.initrd.postDeviceCommands = lib.mkIf (!config.boot.initrd.systemd.enable) (commonFunctions + lib.concatStrings (lib.mapAttrsToList openCommand bootFs));
125146126147 boot.initrd.systemd.services = lib.mapAttrs' (mkUnits "/sysroot") bootFs;
127148 })
···2810628106 linuxPackages_testing = linuxKernel.packages.linux_testing;
2810728107 linux_testing = linuxKernel.kernels.linux_testing;
28108281082810928109+ # FIXME: Remove and alias to `linux(Packages)_testing`` after 23.11 is released
2810928110 linuxPackages_testing_bcachefs = linuxKernel.packages.linux_testing_bcachefs;
2811028111 linux_testing_bcachefs = linuxKernel.kernels.linux_testing_bcachefs;
2811128112
+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);