Make custom kernel accept boot.kernelPatches

This commit is contained in:
TheK0tYaRa 2026-03-17 23:47:55 +02:00
parent 91fb4b5fbe
commit 40bcae409d
2 changed files with 153 additions and 138 deletions

View file

@ -6,7 +6,14 @@
}:
{
boot = {
kernelPackages = pkgs.linuxPackagesFor (import ./kernel.nix { inherit pkgs lib kernel-src; });
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./kernel.nix {
inherit lib kernel-src;
structuredExtraConfig = { };
kernelPatches = [ ];
extraConfig = "";
features = { };
randstructSeed = null;
});
kernelPatches = [
{
name = "gpu";

View file

@ -2,12 +2,16 @@
pkgs,
lib,
kernel-src,
buildLinux,
structuredExtraConfig ? { },
kernelPatches ? [ ],
extraConfig ? "",
sccacheDir ? "/var/cache/sccache/nix-builds/kernel",
sccacheServerUds ? null,
enforceSccache ? true,
features ? { },
randstructSeed ? null,
...
}:
let
@ -30,9 +34,14 @@ let
kver = "${V}.${P}.${S}${E}";
in
pkgs.callPackage (
{ buildLinux, ... }@args:
let
args = {
inherit
buildLinux
features
randstructSeed
;
};
llvm = pkgs.llvmPackages_latest;
rust = pkgs.rustc-unwrapped;
@ -182,4 +191,3 @@ pkgs.callPackage (
extraMeta.branch = "${V}.${P}";
}
)
) { }