17 # When adding a kernel:
18 # - Update packageAliases.linux_latest to the latest version
19 # - Update the rev in ../os-specific/linux/kernel/linux-libre.nix to the latest one.
20 # - Update linux_latest_hardened when the patches become available
25 deblobKernel = kernel: callPackage ../os-specific/linux/kernel/linux-libre.nix {
29 markBroken = drv: drv.overrideAttrs ({ meta ? {}, ... }: {
30 meta = meta // { broken = true; };
34 hardenedKernelFor = kernel': overrides:
36 kernel = kernel'.override overrides;
37 version = kernelPatches.hardened.${kernel.meta.branch}.version;
38 major = lib.versions.major version;
39 sha256 = kernelPatches.hardened.${kernel.meta.branch}.sha256;
40 modDirVersion' = builtins.replaceStrings [ kernel.version ] [ version ] kernel.modDirVersion;
42 structuredExtraConfig = import ../os-specific/linux/kernel/hardened/config.nix {
43 inherit stdenv lib version;
47 pname = "linux-hardened";
48 modDirVersion = modDirVersion' + kernelPatches.hardened.${kernel.meta.branch}.extra;
50 url = "mirror://kernel/linux/kernel/v${major}.x/linux-${version}.tar.xz";
54 broken = kernel.meta.broken;
57 kernelPatches = kernel.kernelPatches ++ [
58 kernelPatches.hardened.${kernel.meta.branch}
63 kernelPatches = callPackage ../os-specific/linux/kernel/patches.nix { };
65 kernels = recurseIntoAttrs (lib.makeExtensible (self: with self;
66 let callPackage = newScope self; in {
68 # NOTE: PLEASE DO NOT ADD NEW DOWNSTREAM KERNELS TO NIXPKGS.
69 # New vendor kernels should go to nixos-hardware instead.
70 # e.g. https://github.com/NixOS/nixos-hardware/tree/master/microsoft/surface/kernel
72 linux_rpi1 = callPackage ../os-specific/linux/kernel/linux-rpi.nix {
73 kernelPatches = with kernelPatches; [
80 linux_rpi2 = callPackage ../os-specific/linux/kernel/linux-rpi.nix {
81 kernelPatches = with kernelPatches; [
88 linux_rpi3 = callPackage ../os-specific/linux/kernel/linux-rpi.nix {
89 kernelPatches = with kernelPatches; [
96 linux_rpi4 = callPackage ../os-specific/linux/kernel/linux-rpi.nix {
97 kernelPatches = with kernelPatches; [
104 linux_5_4 = callPackage ../os-specific/linux/kernel/mainline.nix {
107 kernelPatches.bridge_stp_helper
108 kernelPatches.request_key_helper
109 kernelPatches.rtl8761b_support
113 linux_rt_5_4 = callPackage ../os-specific/linux/kernel/linux-rt-5.4.nix {
115 kernelPatches.bridge_stp_helper
116 kernelPatches.request_key_helper
120 linux_5_10 = callPackage ../os-specific/linux/kernel/mainline.nix {
123 kernelPatches.bridge_stp_helper
124 kernelPatches.request_key_helper
128 linux_rt_5_10 = callPackage ../os-specific/linux/kernel/linux-rt-5.10.nix {
130 kernelPatches.bridge_stp_helper
131 kernelPatches.request_key_helper
132 kernelPatches.export-rt-sched-migrate
136 linux_5_15 = callPackage ../os-specific/linux/kernel/mainline.nix {
139 kernelPatches.bridge_stp_helper
140 kernelPatches.request_key_helper
144 linux_rt_5_15 = callPackage ../os-specific/linux/kernel/linux-rt-5.15.nix {
146 kernelPatches.bridge_stp_helper
147 kernelPatches.request_key_helper
148 kernelPatches.export-rt-sched-migrate
152 linux_6_1 = callPackage ../os-specific/linux/kernel/mainline.nix {
155 kernelPatches.bridge_stp_helper
156 kernelPatches.request_key_helper
160 linux_rt_6_1 = callPackage ../os-specific/linux/kernel/linux-rt-6.1.nix {
162 kernelPatches.bridge_stp_helper
163 kernelPatches.request_key_helper
164 kernelPatches.export-rt-sched-migrate
168 linux_6_6 = callPackage ../os-specific/linux/kernel/mainline.nix {
171 kernelPatches.bridge_stp_helper
172 kernelPatches.request_key_helper
176 linux_rt_6_6 = callPackage ../os-specific/linux/kernel/linux-rt-6.6.nix {
178 kernelPatches.bridge_stp_helper
179 kernelPatches.request_key_helper
180 kernelPatches.export-rt-sched-migrate
184 linux_6_11 = callPackage ../os-specific/linux/kernel/mainline.nix {
187 kernelPatches.bridge_stp_helper
188 kernelPatches.request_key_helper
193 testing = callPackage ../os-specific/linux/kernel/mainline.nix {
194 # A special branch that tracks the kernel under the release process
195 # i.e. which has at least a public rc1 and is not released yet.
198 kernelPatches.bridge_stp_helper
199 kernelPatches.request_key_helper
202 latest = packageAliases.linux_latest.kernel;
203 in if latest.kernelAtLeast testing.baseVersion
207 # Using zenKernels like this due lqx&zen came from one source, but may have different base kernel version
208 # https://github.com/NixOS/nixpkgs/pull/161773#discussion_r820134708
209 zenKernels = callPackage ../os-specific/linux/kernel/zen-kernels.nix;
211 linux_zen = zenKernels {
214 kernelPatches.bridge_stp_helper
215 kernelPatches.request_key_helper
219 linux_lqx = zenKernels {
222 kernelPatches.bridge_stp_helper
223 kernelPatches.request_key_helper
227 # This contains the variants of the XanMod kernel
228 xanmodKernels = callPackage ../os-specific/linux/kernel/xanmod-kernels.nix;
230 linux_xanmod = xanmodKernels {
233 kernelPatches.bridge_stp_helper
234 kernelPatches.request_key_helper
237 linux_xanmod_stable = xanmodKernels {
240 kernelPatches.bridge_stp_helper
241 kernelPatches.request_key_helper
244 linux_xanmod_latest = xanmodKernels {
247 kernelPatches.bridge_stp_helper
248 kernelPatches.request_key_helper
252 linux_libre = deblobKernel packageAliases.linux_default.kernel;
254 linux_latest_libre = deblobKernel packageAliases.linux_latest.kernel;
256 linux_hardened = hardenedKernelFor packageAliases.linux_default.kernel { };
258 linux_5_4_hardened = markBroken (hardenedKernelFor kernels.linux_5_4 {
259 stdenv = gcc10Stdenv;
260 buildPackages = buildPackages // { stdenv = buildPackages.gcc10Stdenv; };
262 linux_5_10_hardened = hardenedKernelFor kernels.linux_5_10 { };
263 linux_5_15_hardened = hardenedKernelFor kernels.linux_5_15 { };
264 linux_6_1_hardened = hardenedKernelFor kernels.linux_6_1 { };
265 linux_6_6_hardened = hardenedKernelFor kernels.linux_6_6 { };
267 } // lib.optionalAttrs config.allowAliases {
268 linux_4_14 = throw "linux 4.14 was removed because it will reach its end of life within 23.11";
269 linux_4_19 = throw "linux 4.19 was removed because it will reach its end of life within 24.11";
270 linux_6_4 = throw "linux 6.4 was removed because it has reached its end of life upstream";
271 linux_6_5 = throw "linux 6.5 was removed because it has reached its end of life upstream";
272 linux_6_7 = throw "linux 6.7 was removed because it has reached its end of life upstream";
273 linux_6_8 = throw "linux 6.8 was removed because it has reached its end of life upstream";
274 linux_6_9 = throw "linux 6.9 was removed because it has reached its end of life upstream";
275 linux_6_10 = throw "linux 6.10 was removed because it has reached its end of life upstream";
277 linux_xanmod_tt = throw "linux_xanmod_tt was removed because upstream no longer offers this option";
279 linux_4_14_hardened = throw "linux 4.14 was removed because it will reach its end of life within 23.11";
280 linux_4_19_hardened = throw "linux 4.19 was removed because it will reach its end of life within 24.11";
281 linux_6_4_hardened = throw "linux 6.4 was removed because it has reached its end of life upstream";
282 linux_6_5_hardened = throw "linux 6.5 was removed because it has reached its end of life upstream";
283 linux_6_7_hardened = throw "linux 6.7 was removed because it has reached its end of life upstream";
284 linux_6_8_hardened = throw "linux 6.8 was removed because it has reached its end of life upstream";
285 linux_6_9_hardened = throw "linux 6.9 was removed because it has reached its end of life upstream";
286 linux_6_10_hardened = throw "linux 6.10 was removed because it has reached its end of life upstream";
288 /* Linux kernel modules are inherently tied to a specific kernel. So
289 rather than provide specific instances of those packages for a
290 specific kernel, we have a function that builds those packages
291 for a specific kernel. This function can then be called for
292 whatever kernel you're using. */
294 packagesFor = kernel_: lib.makeExtensible (self: with self;
295 let callPackage = newScope self; in {
298 inherit (kernel) stdenv; # in particular, use the same compiler by default
300 # to help determine module compatibility
301 inherit (kernel) isZen isHardened isLibre;
302 inherit (kernel) kernelOlder kernelAtLeast;
303 # Obsolete aliases (these packages do not depend on the kernel).
304 inherit (pkgs) odp-dpdk pktgen; # added 2018-05
305 inherit (pkgs) bcc bpftrace; # added 2021-12
306 inherit (pkgs) oci-seccomp-bpf-hook; # added 2022-11
307 inherit (pkgs) dpdk; # added 2024-03
309 acpi_call = callPackage ../os-specific/linux/acpi-call {};
311 akvcam = callPackage ../os-specific/linux/akvcam { };
313 apfs = callPackage ../os-specific/linux/apfs { };
315 ax99100 = callPackage ../os-specific/linux/ax99100 {};
317 batman_adv = callPackage ../os-specific/linux/batman-adv {};
319 bbswitch = callPackage ../os-specific/linux/bbswitch {};
321 ch9344 = callPackage ../os-specific/linux/ch9344 { };
323 chipsec = callPackage ../tools/security/chipsec {
328 cryptodev = callPackage ../os-specific/linux/cryptodev { };
330 cpupower = callPackage ../os-specific/linux/cpupower { };
332 deepin-anything-module = callPackage ../os-specific/linux/deepin-anything-module { };
334 ddcci-driver = callPackage ../os-specific/linux/ddcci { };
336 dddvb = callPackage ../os-specific/linux/dddvb { };
338 decklink = callPackage ../os-specific/linux/decklink { };
340 digimend = callPackage ../os-specific/linux/digimend { };
342 dpdk-kmods = callPackage ../os-specific/linux/dpdk-kmods { };
344 exfat-nofuse = if lib.versionOlder kernel.version "5.8" then callPackage ../os-specific/linux/exfat { } else null;
346 evdi = callPackage ../os-specific/linux/evdi { };
348 fanout = callPackage ../os-specific/linux/fanout { };
350 framework-laptop-kmod = callPackage ../os-specific/linux/framework-laptop-kmod { };
352 fwts-efi-runtime = callPackage ../os-specific/linux/fwts/module.nix { };
354 gasket = callPackage ../os-specific/linux/gasket { };
356 gcadapter-oc-kmod = callPackage ../os-specific/linux/gcadapter-oc-kmod { };
358 hyperv-daemons = callPackage ../os-specific/linux/hyperv-daemons { };
360 e1000e = if lib.versionOlder kernel.version "4.10" then callPackage ../os-specific/linux/e1000e {} else null;
362 intel-speed-select = if lib.versionAtLeast kernel.version "5.3" then callPackage ../os-specific/linux/intel-speed-select { } else null;
364 ipu6-drivers = callPackage ../os-specific/linux/ipu6-drivers {};
366 ivsc-driver = callPackage ../os-specific/linux/ivsc-driver {};
368 ixgbevf = callPackage ../os-specific/linux/ixgbevf {};
370 it87 = callPackage ../os-specific/linux/it87 {};
372 asus-ec-sensors = callPackage ../os-specific/linux/asus-ec-sensors {};
374 asus-wmi-sensors = callPackage ../os-specific/linux/asus-wmi-sensors {};
376 ena = callPackage ../os-specific/linux/ena {};
378 lenovo-legion-module = callPackage ../os-specific/linux/lenovo-legion { };
380 linux-gpib = callPackage ../applications/science/electronics/linux-gpib/kernel.nix { };
382 liquidtux = callPackage ../os-specific/linux/liquidtux {};
384 lkrg = callPackage ../os-specific/linux/lkrg {};
386 v4l2loopback = callPackage ../os-specific/linux/v4l2loopback { };
388 lttng-modules = callPackage ../os-specific/linux/lttng-modules { };
390 mstflint_access = callPackage ../os-specific/linux/mstflint_access { };
392 broadcom_sta = callPackage ../os-specific/linux/broadcom-sta { };
394 tbs = callPackage ../os-specific/linux/tbs { };
396 mbp2018-bridge-drv = callPackage ../os-specific/linux/mbp-modules/mbp2018-bridge-drv { };
398 nct6687d = callPackage ../os-specific/linux/nct6687d { };
400 new-lg4ff = callPackage ../os-specific/linux/new-lg4ff { };
402 zenergy = callPackage ../os-specific/linux/zenergy { };
404 nvidiabl = callPackage ../os-specific/linux/nvidiabl { };
406 nvidiaPackages = dontRecurseIntoAttrs (lib.makeExtensible (_: callPackage ../os-specific/linux/nvidia-x11 { }));
408 nvidia_x11 = nvidiaPackages.stable;
409 nvidia_x11_beta = nvidiaPackages.beta;
410 nvidia_x11_legacy340 = nvidiaPackages.legacy_340;
411 nvidia_x11_legacy390 = nvidiaPackages.legacy_390;
412 nvidia_x11_legacy470 = nvidiaPackages.legacy_470;
413 nvidia_x11_legacy535 = nvidiaPackages.legacy_535;
414 nvidia_x11_production = nvidiaPackages.production;
415 nvidia_x11_vulkan_beta = nvidiaPackages.vulkan_beta;
416 nvidia_dc = nvidiaPackages.dc;
417 nvidia_dc_520 = nvidiaPackages.dc_520;
418 nvidia_dc_535 = nvidiaPackages.dc_535;
420 # this is not a replacement for nvidia_x11*
421 # only the opensource kernel driver exposed for hydra to build
422 nvidia_x11_beta_open = nvidiaPackages.beta.open;
423 nvidia_x11_production_open = nvidiaPackages.production.open;
424 nvidia_x11_stable_open = nvidiaPackages.stable.open;
425 nvidia_x11_vulkan_beta_open = nvidiaPackages.vulkan_beta.open;
427 openrazer = callPackage ../os-specific/linux/openrazer/driver.nix { };
429 ply = callPackage ../os-specific/linux/ply { };
431 r8125 = callPackage ../os-specific/linux/r8125 { };
433 r8168 = callPackage ../os-specific/linux/r8168 { };
435 rtl8188eus-aircrack = callPackage ../os-specific/linux/rtl8188eus-aircrack { };
437 rtl8192eu = callPackage ../os-specific/linux/rtl8192eu { };
439 rtl8189es = callPackage ../os-specific/linux/rtl8189es { };
441 rtl8189fs = callPackage ../os-specific/linux/rtl8189fs { };
443 rtl8723ds = callPackage ../os-specific/linux/rtl8723ds { };
445 rtl8812au = callPackage ../os-specific/linux/rtl8812au { };
447 rtl8814au = callPackage ../os-specific/linux/rtl8814au { };
449 rtl8852au = callPackage ../os-specific/linux/rtl8852au { };
451 rtl8852bu = callPackage ../os-specific/linux/rtl8852bu { };
453 rtl88xxau-aircrack = callPackage ../os-specific/linux/rtl88xxau-aircrack {};
455 rtl8821au = callPackage ../os-specific/linux/rtl8821au { };
457 rtl8821ce = callPackage ../os-specific/linux/rtl8821ce { };
459 rtl88x2bu = callPackage ../os-specific/linux/rtl88x2bu { };
461 rtl8821cu = callPackage ../os-specific/linux/rtl8821cu { };
463 rtw88 = callPackage ../os-specific/linux/rtw88 { };
465 rtw89 = if lib.versionOlder kernel.version "5.16" then callPackage ../os-specific/linux/rtw89 { } else null;
467 openafs_1_8 = callPackage ../servers/openafs/1.8/module.nix { };
468 # Current stable release; don't backport release updates!
469 openafs = openafs_1_8;
471 opensnitch-ebpf = if lib.versionAtLeast kernel.version "5.10" then callPackage ../os-specific/linux/opensnitch-ebpf { } else null;
473 facetimehd = callPackage ../os-specific/linux/facetimehd { };
475 rust-out-of-tree-module = if lib.versionAtLeast kernel.version "6.7" then callPackage ../os-specific/linux/rust-out-of-tree-module { } else null;
477 tuxedo-keyboard = if lib.versionAtLeast kernel.version "4.14" then callPackage ../os-specific/linux/tuxedo-keyboard { } else null;
479 jool = callPackage ../os-specific/linux/jool { };
481 kvmfr = callPackage ../os-specific/linux/kvmfr { };
483 mba6x_bl = callPackage ../os-specific/linux/mba6x_bl { };
485 mwprocapture = callPackage ../os-specific/linux/mwprocapture { };
487 mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { };
489 # compiles but has to be integrated into the kernel somehow
490 # Let's have it uncommented and finish it..
491 ndiswrapper = callPackage ../os-specific/linux/ndiswrapper { };
493 netatop = callPackage ../os-specific/linux/netatop { };
495 perf = callPackage ../os-specific/linux/kernel/perf { };
497 phc-intel = if lib.versionAtLeast kernel.version "4.10" then callPackage ../os-specific/linux/phc-intel { } else null;
499 prl-tools = callPackage ../os-specific/linux/prl-tools { };
501 isgx = callPackage ../os-specific/linux/isgx { };
503 rr-zen_workaround = callPackage ../development/tools/analysis/rr/zen_workaround.nix { };
505 shufflecake = callPackage ../os-specific/linux/shufflecake {};
507 sysdig = callPackage ../os-specific/linux/sysdig {};
509 systemtap = callPackage ../development/tools/profiling/systemtap { };
511 system76 = callPackage ../os-specific/linux/system76 { };
513 system76-acpi = callPackage ../os-specific/linux/system76-acpi { };
515 system76-io = callPackage ../os-specific/linux/system76-io { };
517 tmon = callPackage ../os-specific/linux/tmon { };
519 tp_smapi = callPackage ../os-specific/linux/tp_smapi { };
521 turbostat = callPackage ../os-specific/linux/turbostat { };
523 corefreq = callPackage ../os-specific/linux/corefreq { };
525 trelay = callPackage ../os-specific/linux/trelay { };
527 universal-pidff = callPackage ../os-specific/linux/universal-pidff { };
529 usbip = callPackage ../os-specific/linux/usbip { };
531 v86d = callPackage ../os-specific/linux/v86d { };
533 veikk-linux-driver = callPackage ../os-specific/linux/veikk-linux-driver { };
534 vendor-reset = callPackage ../os-specific/linux/vendor-reset { };
536 vhba = callPackage ../applications/emulators/cdemu/vhba.nix { };
538 virtio_vmmci = callPackage ../os-specific/linux/virtio_vmmci { };
540 virtualbox = callPackage ../os-specific/linux/virtualbox {
541 virtualbox = pkgs.virtualboxHardened;
544 virtualboxGuestAdditions = callPackage ../applications/virtualization/virtualbox/guest-additions { };
546 mm-tools = callPackage ../os-specific/linux/mm-tools { };
548 vmm_clock = callPackage ../os-specific/linux/vmm_clock { };
550 vmware = callPackage ../os-specific/linux/vmware { };
552 wireguard = if lib.versionOlder kernel.version "5.6" then callPackage ../os-specific/linux/wireguard { } else null;
554 x86_energy_perf_policy = callPackage ../os-specific/linux/x86_energy_perf_policy { };
556 xone = if lib.versionAtLeast kernel.version "5.4" then callPackage ../os-specific/linux/xone { } else null;
558 xpadneo = callPackage ../os-specific/linux/xpadneo { };
560 ithc = callPackage ../os-specific/linux/ithc { };
562 ryzen-smu = callPackage ../os-specific/linux/ryzen-smu { };
564 zenpower = callPackage ../os-specific/linux/zenpower { };
566 zfs_2_1 = callPackage ../os-specific/linux/zfs/2_1.nix {
567 configFile = "kernel";
570 zfs_2_2 = callPackage ../os-specific/linux/zfs/2_2.nix {
571 configFile = "kernel";
574 zfs_unstable = callPackage ../os-specific/linux/zfs/unstable.nix {
575 configFile = "kernel";
580 can-isotp = callPackage ../os-specific/linux/can-isotp { };
582 qc71_laptop = callPackage ../os-specific/linux/qc71_laptop { };
584 hid-ite8291r3 = callPackage ../os-specific/linux/hid-ite8291r3 { };
586 hid-t150 = callPackage ../os-specific/linux/hid-t150 { };
588 hid-tmff2 = callPackage ../os-specific/linux/hid-tmff2 { };
590 hpuefi-mod = callPackage ../os-specific/linux/hpuefi-mod { };
592 drbd = callPackage ../os-specific/linux/drbd/driver.nix { };
594 nullfs = callPackage ../os-specific/linux/nullfs { };
596 msi-ec = callPackage ../os-specific/linux/msi-ec { };
598 } // lib.optionalAttrs config.allowAliases {
599 ati_drivers_x11 = throw "ati drivers are no longer supported by any kernel >=4.1"; # added 2021-05-18;
600 hid-nintendo = throw "hid-nintendo was added in mainline kernel version 5.16"; # Added 2023-07-30
601 sch_cake = throw "sch_cake was added in mainline kernel version 4.19"; # Added 2023-06-14
602 rtl8723bs = throw "rtl8723bs was added in mainline kernel version 4.12"; # Added 2023-06-14
603 vm-tools = self.mm-tools;
604 xmm7360-pci = throw "Support for the XMM7360 WWAN card was added to the iosm kmod in mainline kernel version 5.18";
605 amdgpu-pro = throw "amdgpu-pro was removed due to lack of maintenance"; # Added 2024-06-16
606 kvdo = throw "kvdo was removed, because it was added to mainline in kernel version 6.9"; # Added 2024-07-08
607 system76-power = lib.warn "kernelPackages.system76-power is now pkgs.system76-power" pkgs.system76-power; # Added 2024-10-16
608 system76-scheduler = lib.warn "kernelPackages.system76-scheduler is now pkgs.system76-scheduler" pkgs.system76-scheduler; # Added 2024-10-16
611 hardenedPackagesFor = kernel: overrides: packagesFor (hardenedKernelFor kernel overrides);
614 # recurse to build modules for the kernels
615 linux_5_4 = recurseIntoAttrs (packagesFor kernels.linux_5_4);
616 linux_5_10 = recurseIntoAttrs (packagesFor kernels.linux_5_10);
617 linux_5_15 = recurseIntoAttrs (packagesFor kernels.linux_5_15);
618 linux_6_1 = recurseIntoAttrs (packagesFor kernels.linux_6_1);
619 linux_6_6 = recurseIntoAttrs (packagesFor kernels.linux_6_6);
620 linux_6_11 = recurseIntoAttrs (packagesFor kernels.linux_6_11);
621 } // lib.optionalAttrs config.allowAliases {
622 linux_4_14 = throw "linux 4.14 was removed because it will reach its end of life within 23.11"; # Added 2023-10-11
623 linux_4_19 = throw "linux 4.19 was removed because it will reach its end of life within 24.11"; # Added 2024-09-21
624 linux_6_4 = throw "linux 6.4 was removed because it reached its end of life upstream"; # Added 2023-10-02
625 linux_6_5 = throw "linux 6.5 was removed because it reached its end of life upstream"; # Added 2024-02-28
626 linux_6_7 = throw "linux 6.7 was removed because it reached its end of life upstream"; # Added 2024-04-04
627 linux_6_8 = throw "linux 6.8 was removed because it reached its end of life upstream"; # Added 2024-08-02
628 linux_6_9 = throw "linux 6.9 was removed because it reached its end of life upstream"; # Added 2024-08-02
629 linux_6_10 = throw "linux 6.10 was removed because it reached its end of life upstream"; # Added 2024-10-23
633 # realtime kernel packages
634 linux_rt_5_4 = packagesFor kernels.linux_rt_5_4;
635 linux_rt_5_10 = packagesFor kernels.linux_rt_5_10;
636 linux_rt_5_15 = packagesFor kernels.linux_rt_5_15;
637 linux_rt_6_1 = packagesFor kernels.linux_rt_6_1;
638 linux_rt_6_6 = packagesFor kernels.linux_rt_6_6;
642 linux_rpi1 = packagesFor kernels.linux_rpi1;
643 linux_rpi2 = packagesFor kernels.linux_rpi2;
644 linux_rpi3 = packagesFor kernels.linux_rpi3;
645 linux_rpi4 = packagesFor kernels.linux_rpi4;
648 packages = recurseIntoAttrs (vanillaPackages // rtPackages // rpiPackages // {
650 # Intentionally lacks recurseIntoAttrs, as -rc kernels will quite likely break out-of-tree modules and cause failed Hydra builds.
651 linux_testing = packagesFor kernels.linux_testing;
653 linux_hardened = recurseIntoAttrs (packagesFor kernels.linux_hardened);
655 linux_5_4_hardened = recurseIntoAttrs (packagesFor kernels.linux_5_4_hardened);
656 linux_5_10_hardened = recurseIntoAttrs (packagesFor kernels.linux_5_10_hardened);
657 linux_5_15_hardened = recurseIntoAttrs (packagesFor kernels.linux_5_15_hardened);
658 linux_6_1_hardened = recurseIntoAttrs (packagesFor kernels.linux_6_1_hardened);
659 linux_6_6_hardened = recurseIntoAttrs (packagesFor kernels.linux_6_6_hardened);
661 linux_zen = recurseIntoAttrs (packagesFor kernels.linux_zen);
662 linux_lqx = recurseIntoAttrs (packagesFor kernels.linux_lqx);
663 linux_xanmod = recurseIntoAttrs (packagesFor kernels.linux_xanmod);
664 linux_xanmod_stable = recurseIntoAttrs (packagesFor kernels.linux_xanmod_stable);
665 linux_xanmod_latest = recurseIntoAttrs (packagesFor kernels.linux_xanmod_latest);
667 linux_libre = recurseIntoAttrs (packagesFor kernels.linux_libre);
669 linux_latest_libre = recurseIntoAttrs (packagesFor kernels.linux_latest_libre);
670 __recurseIntoDerivationForReleaseJobs = true;
671 } // lib.optionalAttrs config.allowAliases {
672 linux_4_14_hardened = throw "linux 4.14 was removed because it will reach its end of life within 23.11";
673 linux_4_19_hardened = throw "linux 4.19 was removed because it will reach its end of life within 24.11";
674 linux_6_4_hardened = throw "linux 6.4 was removed because it has reached its end of life upstream";
675 linux_6_5_hardened = throw "linux 6.5 was removed because it has reached its end of life upstream";
676 linux_6_7_hardened = throw "linux 6.7 was removed because it has reached its end of life upstream";
677 linux_6_8_hardened = throw "linux 6.8 was removed because it has reached its end of life upstream";
678 linux_6_9_hardened = throw "linux 6.9 was removed because it has reached its end of life upstream";
679 linux_xanmod_tt = throw "linux_xanmod_tt was removed because upstream no longer offers this option";
683 linux_default = packages.linux_6_6;
684 # Update this when adding the newest kernel major version!
685 linux_latest = packages.linux_6_11;
686 linux_mptcp = throw "'linux_mptcp' has been moved to https://github.com/teto/mptcp-flake";
687 linux_rt_default = packages.linux_rt_5_15;
688 linux_rt_latest = packages.linux_rt_6_6;
691 manualConfig = callPackage ../os-specific/linux/kernel/manual-config.nix {};
693 customPackage = { version, src, modDirVersion ? lib.versions.pad 3 version, configfile, allowImportFromDerivation ? true }:
694 recurseIntoAttrs (packagesFor (manualConfig {
695 inherit version src modDirVersion configfile allowImportFromDerivation;
698 # Derive one of the default .config files
702 version ? (builtins.parseDrvName src.name).version,
703 makeTarget ? "defconfig",
704 name ? "kernel.config",
705 }: stdenvNoCC.mkDerivation {
707 depsBuildBuild = [ buildPackages.stdenv.cc ]
708 ++ lib.optionals (lib.versionAtLeast version "4.16") [ buildPackages.bison buildPackages.flex ];
709 patches = map (p: p.patch) kernelPatches; # Patches may include new configs.
711 patchShebangs scripts/
716 ARCH=${stdenv.hostPlatform.linuxArch} \
717 HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc \
725 buildLinux = callPackage ../os-specific/linux/kernel/generic.nix {};