modules.system.kernel: add 6.18 btrfs patch

This commit is contained in:
2025-12-14 11:51:50 +08:00
parent f317e2db15
commit e6d17c8ca6
2 changed files with 28 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
{ inputs }: let inherit (inputs.self.packages.x86_64-linux) pkgs; in
{ inputs }: let inherit (inputs.self.packages.x86_64-linux) pkgs; inherit (inputs.nixpkgs) lib; in
{
nvhpc =
{
@@ -208,4 +208,25 @@
finalImageTag = "v8.0.12";
};
};
btrfs =
{
"6.12" =
{
patch = pkgs.fetchurl
{
url = "https://github.com/kakra/linux/pull/36.patch";
sha256 = "0wimihsvrxib6g23jcqdbvqlkqk6nbqjswfx9bzmpm1vlvzxj8m0";
};
structuredExtraConfig.BTRFS_EXPERIMENTAL = lib.kernel.yes;
};
"6.18" =
{
patch = pkgs.fetchurl
{
url = "https://github.com/kakra/linux/pull/40.patch";
sha256 = "00k57gx5xmwsdr83qc24dwkiin1qcyl929262m9kix699g7fclga";
};
structuredExtraConfig = { BTRFS_ALLOCATOR_HINTS = lib.kernel.yes; BTRFS_READ_POLICIES = lib.kernel.yes; };
};
};
}

View File

@@ -62,19 +62,12 @@ inputs:
cachyos-rc = inputs.pkgs.linuxPackages_cachyos-rc;
}.${kernel.variant};
kernelPatches =
let patches =
{
btrfs =
[{
name = "btrfs";
patch = inputs.pkgs.fetchurl
{
url = "https://github.com/kakra/linux/pull/36.patch";
sha256 = "0wimihsvrxib6g23jcqdbvqlkqk6nbqjswfx9bzmpm1vlvzxj8m0";
};
structuredExtraConfig.BTRFS_EXPERIMENTAL = inputs.lib.kernel.yes;
}];
};
let
version = inputs.lib.versions.majorMinor inputs.config.boot.kernelPackages.kernel.version;
patches =
{
btrfs = [(inputs.topInputs.self.src.btrfs.${version} // { name = "btrfs"; })];
};
in builtins.concatLists (builtins.map (name: patches.${name}) kernel.patches);
};
};