Use applyPatches to simplify code

This commit is contained in:
Lan Tian 2025-12-28 02:15:23 -08:00
parent 696f7401aa
commit 9f04a1fade
No known key found for this signature in database
GPG Key ID: 04E66B6B25A0862B

View File

@ -5,6 +5,7 @@
buildLinux,
stdenv,
kernelPatches,
applyPatches,
...
}:
lib.makeOverridable (
@ -74,9 +75,9 @@ lib.makeOverridable (
);
# buildLinux doesn't accept postPatch, so adding config file early here
patchedSrc = stdenv.mkDerivation {
pname = "${pname}-src";
inherit version src prePatch;
patchedSrc = applyPatches {
name = "linux-src-patched";
inherit src;
patches = [
kernelPatches.bridge_stp_helper.patch
kernelPatches.request_key_helper.patch
@ -87,13 +88,6 @@ lib.makeOverridable (
install -Dm644 ${cachyosConfigFile} arch/x86/configs/cachyos_defconfig
''
+ postPatch;
dontConfigure = true;
dontBuild = true;
dontFixup = true;
installPhase = ''
mkdir -p $out
cp -r * $out/
'';
};
defaultLocalVersion = if lto == "none" then "-cachyos" else "-cachyos-lto";