···3031[`sudo-rs`]: https://github.com/memorysafety/sudo-rs/
3200033- All [ROCm](https://rocm.docs.amd.com/en/latest/) packages have been updated to 5.7.0.
34 - [ROCm](https://rocm.docs.amd.com/en/latest/) package attribute sets are versioned: `rocmPackages` -> `rocmPackages_5`.
35
···3031[`sudo-rs`]: https://github.com/memorysafety/sudo-rs/
3233+- `linuxPackages_testing_bcachefs` is now soft-deprecated by `linuxPackages_testing`.
34+ - Please consider changing your NixOS configuration's `boot.kernelPackages` to `linuxPackages_testing` until a stable kernel with bcachefs support is released.
35+36- All [ROCm](https://rocm.docs.amd.com/en/latest/) packages have been updated to 5.7.0.
37 - [ROCm](https://rocm.docs.amd.com/en/latest/) package attribute sets are versioned: `rocmPackages` -> `rocmPackages_5`.
38
+31-10
nixos/modules/tasks/filesystems/bcachefs.nix
···1{ config, lib, pkgs, utils, ... }:
23-with lib;
4-5let
67- bootFs = filterAttrs (n: fs: (fs.fsType == "bcachefs") && (utils.fsNeededForBoot fs)) config.fileSystems;
89 commonFunctions = ''
10 prompt() {
···56 # remove this adaptation when bcachefs implements mounting by filesystem uuid
57 # also, implement automatic waiting for the constituent devices when that happens
58 # bcachefs does not support mounting devices with colons in the path, ergo we don't (see #49671)
59- firstDevice = fs: head (splitString ":" fs.device);
6061 openCommand = name: fs: ''
62 tryUnlock ${name} ${firstDevice fs}
···90 };
91 };
920000000000000000093in
9495{
96- config = mkIf (elem "bcachefs" config.boot.supportedFilesystems) (mkMerge [
97 {
098 # needed for systemd-remount-fs
99 system.fsPackages = [ pkgs.bcachefs-tools ];
100101- # use kernel package with bcachefs support until it's in mainline
102- # TODO replace with requireKernelConfig
103- boot.kernelPackages = pkgs.linuxPackages_testing_bcachefs;
0000104105 systemd.services = lib.mapAttrs' (mkUnits "") (lib.filterAttrs (n: fs: (fs.fsType == "bcachefs") && (!utils.fsNeededForBoot fs)) config.fileSystems);
106 }
107108- (mkIf ((elem "bcachefs" config.boot.initrd.supportedFilesystems) || (bootFs != {})) {
0109 # chacha20 and poly1305 are required only for decryption attempts
110 boot.initrd.availableKernelModules = [ "bcachefs" "sha256" "chacha20" "poly1305" ];
111 boot.initrd.systemd.extraBin = {
···121 $out/bin/bcachefs version
122 '';
123124- boot.initrd.postDeviceCommands = lib.mkIf (!config.boot.initrd.systemd.enable) (commonFunctions + concatStrings (mapAttrsToList openCommand bootFs));
125126 boot.initrd.systemd.services = lib.mapAttrs' (mkUnits "/sysroot") bootFs;
127 })
···1{ config, lib, pkgs, utils, ... }:
2003let
45+ bootFs = lib.filterAttrs (n: fs: (fs.fsType == "bcachefs") && (utils.fsNeededForBoot fs)) config.fileSystems;
67 commonFunctions = ''
8 prompt() {
···54 # remove this adaptation when bcachefs implements mounting by filesystem uuid
55 # also, implement automatic waiting for the constituent devices when that happens
56 # bcachefs does not support mounting devices with colons in the path, ergo we don't (see #49671)
57+ firstDevice = fs: lib.head (lib.splitString ":" fs.device);
5859 openCommand = name: fs: ''
60 tryUnlock ${name} ${firstDevice fs}
···88 };
89 };
9091+ 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+ ];
108in
109110{
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 ];
116117+ # 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+ );
124125 systemd.services = lib.mapAttrs' (mkUnits "") (lib.filterAttrs (n: fs: (fs.fsType == "bcachefs") && (!utils.fsNeededForBoot fs)) config.fileSystems);
126 }
127128+ (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 = {
···142 $out/bin/bcachefs version
143 '';
144145+ boot.initrd.postDeviceCommands = lib.mkIf (!config.boot.initrd.systemd.enable) (commonFunctions + lib.concatStrings (lib.mapAttrsToList openCommand bootFs));
146147 boot.initrd.systemd.services = lib.mapAttrs' (mkUnits "/sysroot") bootFs;
148 })
+62
nixos/tests/installer.nix
···991 '';
992 };
99300000000000000000000000000000000000000000000000000000000000000994 # Test using labels to identify volumes in grub
995 simpleLabels = makeInstallerTest "simpleLabels" {
996 createPartitions = ''
···28106 linuxPackages_testing = linuxKernel.packages.linux_testing;
28107 linux_testing = linuxKernel.kernels.linux_testing;
2810828109+ # FIXME: Remove and alias to `linux(Packages)_testing`` after 23.11 is released
28110 linuxPackages_testing_bcachefs = linuxKernel.packages.linux_testing_bcachefs;
28111 linux_testing_bcachefs = linuxKernel.kernels.linux_testing_bcachefs;
28112
+2
pkgs/top-level/linux-kernels.nix
···201 then latest
202 else testing;
2030204 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;
···612613 # 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;
0615 linux_testing_bcachefs = recurseIntoAttrs (packagesFor kernels.linux_testing_bcachefs);
616617 linux_hardened = recurseIntoAttrs (packagesFor kernels.linux_hardened);
···201 then latest
202 else testing;
203204+ # 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;
···613614 # 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);
618619 linux_hardened = recurseIntoAttrs (packagesFor kernels.linux_hardened);