git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/boot: properly override the kernel in boot.kernelPatches

Previously the code took the kernelPatches of the final derivation, which might or might not be what was passed to the derivation in the original call. The previous behaviour caused various hacks to become neccessary to avoid duplicates in kernelPatches.

commit436f61c878e3992b3d980168a5532416dd5be504 authorDominik Xaver Hörl <hoe.dom@gmx.de> dateWed 26 May 2021, 13:38 (5 years ago) parent339a495
4 files changed+6−6
nixos/modules/system/boot/kernel.nix+3−3 pkgs/os-specific/linux/kernel/linux-rt-5.10.nix+1−1 pkgs/os-specific/linux/kernel/linux-rt-5.11.nix+1−1 pkgs/os-specific/linux/kernel/linux-rt-5.4.nix+1−1
nixos/modules/system/boot/kernel.nix+3−3
@@ -38,11 +38,11 @@ in
3838 default = pkgs.linuxPackages;
3939 type = types.unspecified // { merge = mergeEqualOption; };
4040 apply = kernelPackages: kernelPackages.extend (self: super: {
41− kernel = super.kernel.override {
41+ kernel = super.kernel.override (originalArgs: {
4242 inherit randstructSeed;
43− kernelPatches = super.kernel.kernelPatches ++ kernelPatches;
43+ kernelPatches = (originalArgs.kernelPatches or []) ++ kernelPatches;
4444 features = lib.recursiveUpdate super.kernel.features features;
45− };
45+ });
4646 });
4747 # We don't want to evaluate all of linuxPackages for the manual
4848 # - some of it might not even evaluate correctly.
pkgs/os-specific/linux/kernel/linux-rt-5.10.nix+1−1
@@ -27,7 +27,7 @@ in buildLinux (args // {
2727 url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz";
2828 sha256 = "03gq9y111k4js4cc87yc9y7hyg1wxwbc1bjyjdvb4nrx2wqka79y";
2929 };
30− }; in [ rt-patch ] ++ lib.remove rt-patch kernelPatches;
30+ }; in [ rt-patch ] ++ kernelPatches;
3131
3232 structuredExtraConfig = with lib.kernel; {
3333 PREEMPT_RT = yes;
pkgs/os-specific/linux/kernel/linux-rt-5.11.nix+1−1
@@ -27,7 +27,7 @@ in buildLinux (args // {
2727 url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz";
2828 sha256 = "1az6cn9jj3bnjgwzzrjy1adnrnn06p2vzsnc1iib4xhs0sfr27hc";
2929 };
30− }; in [ rt-patch ] ++ lib.remove rt-patch kernelPatches;
30+ }; in [ rt-patch ] ++ kernelPatches;
3131
3232 structuredExtraConfig = with lib.kernel; {
3333 PREEMPT_RT = yes;
pkgs/os-specific/linux/kernel/linux-rt-5.4.nix+1−1
@@ -23,7 +23,7 @@ in buildLinux (args // {
2323 url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz";
2424 sha256 = "1xh7xi27q58njhfayi2lnk4id7hnlklkgh2zx012gxv4ari76g0k";
2525 };
26− }; in [ rt-patch ] ++ lib.remove rt-patch kernelPatches;
26+ }; in [ rt-patch ] ++ kernelPatches;
2727
2828 structuredExtraConfig = with lib.kernel; {
2929 PREEMPT_RT = yes;