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_10 = callPackage ../os-specific/linux/kernel/mainline.nix {
187 kernelPatches.bridge_stp_helper
188 kernelPatches.request_key_helper
192 linux_6_11 = callPackage ../os-specific/linux/kernel/mainline.nix {
195 kernelPatches.bridge_stp_helper
196 kernelPatches.request_key_helper
201 testing = callPackage ../os-specific/linux/kernel/mainline.nix {
202 # A special branch that tracks the kernel under the release process
203 # i.e. which has at least a public rc1 and is not released yet.
206 kernelPatches.bridge_stp_helper
207 kernelPatches.request_key_helper
210 latest = packageAliases.linux_latest.kernel;
211 in if latest.kernelAtLeast testing.baseVersion
215 # Using zenKernels like this due lqx&zen came from one source, but may have different base kernel version
216 # https://github.com/NixOS/nixpkgs/pull/161773#discussion_r820134708
217 zenKernels = callPackage ../os-specific/linux/kernel/zen-kernels.nix;
219 linux_zen = zenKernels {
222 kernelPatches.bridge_stp_helper
223 kernelPatches.request_key_helper
227 linux_lqx = zenKernels {
230 kernelPatches.bridge_stp_helper
231 kernelPatches.request_key_helper
235 # This contains the variants of the XanMod kernel
236 xanmodKernels = callPackage ../os-specific/linux/kernel/xanmod-kernels.nix;
238 linux_xanmod = xanmodKernels {
241 kernelPatches.bridge_stp_helper
242 kernelPatches.request_key_helper
245 linux_xanmod_stable = xanmodKernels {
248 kernelPatches.bridge_stp_helper
249 kernelPatches.request_key_helper
252 linux_xanmod_latest = xanmodKernels {
255 kernelPatches.bridge_stp_helper
256 kernelPatches.request_key_helper
260 linux_libre = deblobKernel packageAliases.linux_default.kernel;
262 linux_latest_libre = deblobKernel packageAliases.linux_latest.kernel;
264 linux_hardened = hardenedKernelFor packageAliases.linux_default.kernel { };
266 linux_5_4_hardened = markBroken (hardenedKernelFor kernels.linux_5_4 {
267 stdenv = gcc10Stdenv;
268 buildPackages = buildPackages // { stdenv = buildPackages.gcc10Stdenv; };
270 linux_5_10_hardened = hardenedKernelFor kernels.linux_5_10 { };
271 linux_5_15_hardened = hardenedKernelFor kernels.linux_5_15 { };
272 linux_6_1_hardened = hardenedKernelFor kernels.linux_6_1 { };
273 linux_6_6_hardened = hardenedKernelFor kernels.linux_6_6 { };
275 } // lib.optionalAttrs config.allowAliases {
276 linux_4_14 = throw "linux 4.14 was removed because it will reach its end of life within 23.11";
277 linux_4_19 = throw "linux 4.19 was removed because it will reach its end of life within 24.11";
278 linux_6_4 = throw "linux 6.4 was removed because it has reached its end of life upstream";
279 linux_6_5 = throw "linux 6.5 was removed because it has reached its end of life upstream";
280 linux_6_7 = throw "linux 6.7 was removed because it has reached its end of life upstream";
281 linux_6_8 = throw "linux 6.8 was removed because it has reached its end of life upstream";
282 linux_6_9 = throw "linux 6.9 was removed because it has reached its end of life upstream";
284 linux_xanmod_tt = throw "linux_xanmod_tt was removed because upstream no longer offers this option";
286 linux_4_14_hardened = throw "linux 4.14 was removed because it will reach its end of life within 23.11";
287 linux_4_19_hardened = throw "linux 4.19 was removed because it will reach its end of life within 24.11";
288 linux_6_4_hardened = throw "linux 6.4 was removed because it has reached its end of life upstream";
289 linux_6_5_hardened = throw "linux 6.5 was removed because it has reached its end of life upstream";
290 linux_6_7_hardened = throw "linux 6.7 was removed because it has reached its end of life upstream";
291 linux_6_8_hardened = throw "linux 6.8 was removed because it has reached its end of life upstream";
292 linux_6_9_hardened = throw "linux 6.9 was removed because it has reached its end of life upstream";
294 /* Linux kernel modules are inherently tied to a specific kernel. So
295 rather than provide specific instances of those packages for a
296 specific kernel, we have a function that builds those packages
297 for a specific kernel. This function can then be called for
298 whatever kernel you're using. */
300 packagesFor = kernel_: lib.makeExtensible (self: with self;
301 let callPackage = newScope self; in {
304 inherit (kernel) stdenv; # in particular, use the same compiler by default
306 # to help determine module compatibility
307 inherit (kernel) isZen isHardened isLibre;
308 inherit (kernel) kernelOlder kernelAtLeast;
309 # Obsolete aliases (these packages do not depend on the kernel).
310 inherit (pkgs) odp-dpdk pktgen; # added 2018-05
311 inherit (pkgs) bcc bpftrace; # added 2021-12
312 inherit (pkgs) oci-seccomp-bpf-hook; # added 2022-11
313 inherit (pkgs) dpdk; # added 2024-03
315 acpi_call = callPackage ../os-specific/linux/acpi-call {};
317 akvcam = callPackage ../os-specific/linux/akvcam { };
319 apfs = callPackage ../os-specific/linux/apfs { };
321 ax99100 = callPackage ../os-specific/linux/ax99100 {};
323 batman_adv = callPackage ../os-specific/linux/batman-adv {};
325 bbswitch = callPackage ../os-specific/linux/bbswitch {};
327 ch9344 = callPackage ../os-specific/linux/ch9344 { };
329 chipsec = callPackage ../tools/security/chipsec {
334 cryptodev = callPackage ../os-specific/linux/cryptodev { };
336 cpupower = callPackage ../os-specific/linux/cpupower { };
338 deepin-anything-module = callPackage ../os-specific/linux/deepin-anything-module { };
340 ddcci-driver = callPackage ../os-specific/linux/ddcci { };
342 dddvb = callPackage ../os-specific/linux/dddvb { };
344 decklink = callPackage ../os-specific/linux/decklink { };
346 digimend = callPackage ../os-specific/linux/digimend { };
348 dpdk-kmods = callPackage ../os-specific/linux/dpdk-kmods { };
350 exfat-nofuse = if lib.versionOlder kernel.version "5.8" then callPackage ../os-specific/linux/exfat { } else null;
352 evdi = callPackage ../os-specific/linux/evdi { };
354 fanout = callPackage ../os-specific/linux/fanout { };
356 framework-laptop-kmod = callPackage ../os-specific/linux/framework-laptop-kmod { };
358 fwts-efi-runtime = callPackage ../os-specific/linux/fwts/module.nix { };
360 gasket = callPackage ../os-specific/linux/gasket { };
362 gcadapter-oc-kmod = callPackage ../os-specific/linux/gcadapter-oc-kmod { };
364 hyperv-daemons = callPackage ../os-specific/linux/hyperv-daemons { };
366 e1000e = if lib.versionOlder kernel.version "4.10" then callPackage ../os-specific/linux/e1000e {} else null;
368 intel-speed-select = if lib.versionAtLeast kernel.version "5.3" then callPackage ../os-specific/linux/intel-speed-select { } else null;
370 ipu6-drivers = callPackage ../os-specific/linux/ipu6-drivers {};
372 ivsc-driver = callPackage ../os-specific/linux/ivsc-driver {};
374 ixgbevf = callPackage ../os-specific/linux/ixgbevf {};
376 it87 = callPackage ../os-specific/linux/it87 {};
378 asus-ec-sensors = callPackage ../os-specific/linux/asus-ec-sensors {};
380 asus-wmi-sensors = callPackage ../os-specific/linux/asus-wmi-sensors {};
382 ena = callPackage ../os-specific/linux/ena {};
384 lenovo-legion-module = callPackage ../os-specific/linux/lenovo-legion { };
386 linux-gpib = callPackage ../applications/science/electronics/linux-gpib/kernel.nix { };
388 liquidtux = callPackage ../os-specific/linux/liquidtux {};
390 lkrg = callPackage ../os-specific/linux/lkrg {};
392 v4l2loopback = callPackage ../os-specific/linux/v4l2loopback { };
394 lttng-modules = callPackage ../os-specific/linux/lttng-modules { };
396 mstflint_access = callPackage ../os-specific/linux/mstflint_access { };
398 broadcom_sta = callPackage ../os-specific/linux/broadcom-sta { };
400 tbs = callPackage ../os-specific/linux/tbs { };
402 mbp2018-bridge-drv = callPackage ../os-specific/linux/mbp-modules/mbp2018-bridge-drv { };
404 nct6687d = callPackage ../os-specific/linux/nct6687d { };
406 new-lg4ff = callPackage ../os-specific/linux/new-lg4ff { };
408 nvidiabl = callPackage ../os-specific/linux/nvidiabl { };
410 nvidiaPackages = dontRecurseIntoAttrs (lib.makeExtensible (_: callPackage ../os-specific/linux/nvidia-x11 { }));
412 nvidia_x11 = nvidiaPackages.stable;
413 nvidia_x11_beta = nvidiaPackages.beta;
414 nvidia_x11_legacy340 = nvidiaPackages.legacy_340;
415 nvidia_x11_legacy390 = nvidiaPackages.legacy_390;
416 nvidia_x11_legacy470 = nvidiaPackages.legacy_470;
417 nvidia_x11_legacy535 = nvidiaPackages.legacy_535;
418 nvidia_x11_production = nvidiaPackages.production;
419 nvidia_x11_vulkan_beta = nvidiaPackages.vulkan_beta;
420 nvidia_dc = nvidiaPackages.dc;
421 nvidia_dc_520 = nvidiaPackages.dc_520;
422 nvidia_dc_535 = nvidiaPackages.dc_535;
424 # this is not a replacement for nvidia_x11*
425 # only the opensource kernel driver exposed for hydra to build
426 nvidia_x11_beta_open = nvidiaPackages.beta.open;
427 nvidia_x11_production_open = nvidiaPackages.production.open;
428 nvidia_x11_stable_open = nvidiaPackages.stable.open;
429 nvidia_x11_vulkan_beta_open = nvidiaPackages.vulkan_beta.open;
431 openrazer = callPackage ../os-specific/linux/openrazer/driver.nix { };
433 ply = callPackage ../os-specific/linux/ply { };
435 r8125 = callPackage ../os-specific/linux/r8125 { };
437 r8168 = callPackage ../os-specific/linux/r8168 { };
439 rtl8188eus-aircrack = callPackage ../os-specific/linux/rtl8188eus-aircrack { };
441 rtl8192eu = callPackage ../os-specific/linux/rtl8192eu { };
443 rtl8189es = callPackage ../os-specific/linux/rtl8189es { };
445 rtl8189fs = callPackage ../os-specific/linux/rtl8189fs { };
447 rtl8723ds = callPackage ../os-specific/linux/rtl8723ds { };
449 rtl8812au = callPackage ../os-specific/linux/rtl8812au { };
451 rtl8814au = callPackage ../os-specific/linux/rtl8814au { };
453 rtl8852au = callPackage ../os-specific/linux/rtl8852au { };
455 rtl8852bu = callPackage ../os-specific/linux/rtl8852bu { };
457 rtl88xxau-aircrack = callPackage ../os-specific/linux/rtl88xxau-aircrack {};
459 rtl8821au = callPackage ../os-specific/linux/rtl8821au { };
461 rtl8821ce = callPackage ../os-specific/linux/rtl8821ce { };
463 rtl88x2bu = callPackage ../os-specific/linux/rtl88x2bu { };
465 rtl8821cu = callPackage ../os-specific/linux/rtl8821cu { };
467 rtw88 = callPackage ../os-specific/linux/rtw88 { };
469 rtw89 = if lib.versionOlder kernel.version "5.16" then callPackage ../os-specific/linux/rtw89 { } else null;
471 openafs_1_8 = callPackage ../servers/openafs/1.8/module.nix { };
472 # Current stable release; don't backport release updates!
473 openafs = openafs_1_8;
475 opensnitch-ebpf = if lib.versionAtLeast kernel.version "5.10" then callPackage ../os-specific/linux/opensnitch-ebpf { } else null;
477 facetimehd = callPackage ../os-specific/linux/facetimehd { };
479 rust-out-of-tree-module = if lib.versionAtLeast kernel.version "6.7" then callPackage ../os-specific/linux/rust-out-of-tree-module { } else null;
481 tuxedo-keyboard = if lib.versionAtLeast kernel.version "4.14" then callPackage ../os-specific/linux/tuxedo-keyboard { } else null;
483 jool = callPackage ../os-specific/linux/jool { };
485 kvmfr = callPackage ../os-specific/linux/kvmfr { };
487 mba6x_bl = callPackage ../os-specific/linux/mba6x_bl { };
489 mwprocapture = callPackage ../os-specific/linux/mwprocapture { };
491 mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { };
493 # compiles but has to be integrated into the kernel somehow
494 # Let's have it uncommented and finish it..
495 ndiswrapper = callPackage ../os-specific/linux/ndiswrapper { };
497 netatop = callPackage ../os-specific/linux/netatop { };
499 perf = callPackage ../os-specific/linux/kernel/perf { };
501 phc-intel = if lib.versionAtLeast kernel.version "4.10" then callPackage ../os-specific/linux/phc-intel { } else null;
503 prl-tools = callPackage ../os-specific/linux/prl-tools { };
505 isgx = callPackage ../os-specific/linux/isgx { };
507 rr-zen_workaround = callPackage ../development/tools/analysis/rr/zen_workaround.nix { };
509 shufflecake = callPackage ../os-specific/linux/shufflecake {};
511 sysdig = callPackage ../os-specific/linux/sysdig {};
513 systemtap = callPackage ../development/tools/profiling/systemtap { };
515 system76 = callPackage ../os-specific/linux/system76 { };
517 system76-acpi = callPackage ../os-specific/linux/system76-acpi { };
519 system76-io = callPackage ../os-specific/linux/system76-io { };
521 tmon = callPackage ../os-specific/linux/tmon { };
523 tp_smapi = callPackage ../os-specific/linux/tp_smapi { };
525 turbostat = callPackage ../os-specific/linux/turbostat { };
527 trelay = callPackage ../os-specific/linux/trelay { };
529 universal-pidff = callPackage ../os-specific/linux/universal-pidff { };
531 usbip = callPackage ../os-specific/linux/usbip { };
533 v86d = callPackage ../os-specific/linux/v86d { };
535 veikk-linux-driver = callPackage ../os-specific/linux/veikk-linux-driver { };
536 vendor-reset = callPackage ../os-specific/linux/vendor-reset { };
538 vhba = callPackage ../applications/emulators/cdemu/vhba.nix { };
540 virtio_vmmci = callPackage ../os-specific/linux/virtio_vmmci { };
542 virtualbox = callPackage ../os-specific/linux/virtualbox {
543 virtualbox = pkgs.virtualboxHardened;
546 virtualboxGuestAdditions = callPackage ../applications/virtualization/virtualbox/guest-additions { };
548 mm-tools = callPackage ../os-specific/linux/mm-tools { };
550 vmm_clock = callPackage ../os-specific/linux/vmm_clock { };
552 vmware = callPackage ../os-specific/linux/vmware { };
554 wireguard = if lib.versionOlder kernel.version "5.6" then callPackage ../os-specific/linux/wireguard { } else null;
556 x86_energy_perf_policy = callPackage ../os-specific/linux/x86_energy_perf_policy { };
558 xone = if lib.versionAtLeast kernel.version "5.4" then callPackage ../os-specific/linux/xone { } else null;
560 xpadneo = callPackage ../os-specific/linux/xpadneo { };
562 ithc = callPackage ../os-specific/linux/ithc { };
564 ryzen-smu = callPackage ../os-specific/linux/ryzen-smu { };
566 zenpower = callPackage ../os-specific/linux/zenpower { };
568 zfs_2_1 = callPackage ../os-specific/linux/zfs/2_1.nix {
569 configFile = "kernel";
572 zfs_2_2 = callPackage ../os-specific/linux/zfs/2_2.nix {
573 configFile = "kernel";
576 zfs_unstable = callPackage ../os-specific/linux/zfs/unstable.nix {
577 configFile = "kernel";
582 can-isotp = callPackage ../os-specific/linux/can-isotp { };
584 qc71_laptop = callPackage ../os-specific/linux/qc71_laptop { };
586 hid-ite8291r3 = callPackage ../os-specific/linux/hid-ite8291r3 { };
588 hid-t150 = callPackage ../os-specific/linux/hid-t150 { };
590 hid-tmff2 = callPackage ../os-specific/linux/hid-tmff2 { };
592 hpuefi-mod = callPackage ../os-specific/linux/hpuefi-mod { };
594 drbd = callPackage ../os-specific/linux/drbd/driver.nix { };
596 nullfs = callPackage ../os-specific/linux/nullfs { };
598 msi-ec = callPackage ../os-specific/linux/msi-ec { };
600 } // lib.optionalAttrs config.allowAliases {
601 ati_drivers_x11 = throw "ati drivers are no longer supported by any kernel >=4.1"; # added 2021-05-18;
602 hid-nintendo = throw "hid-nintendo was added in mainline kernel version 5.16"; # Added 2023-07-30
603 sch_cake = throw "sch_cake was added in mainline kernel version 4.19"; # Added 2023-06-14
604 rtl8723bs = throw "rtl8723bs was added in mainline kernel version 4.12"; # Added 2023-06-14
605 vm-tools = self.mm-tools;
606 xmm7360-pci = throw "Support for the XMM7360 WWAN card was added to the iosm kmod in mainline kernel version 5.18";
607 amdgpu-pro = throw "amdgpu-pro was removed due to lack of maintenance"; # Added 2024-06-16
608 kvdo = throw "kvdo was removed, because it was added to mainline in kernel version 6.9"; # Added 2024-07-08
609 system76-power = lib.warn "kernelPackages.system76-power is now pkgs.system76-power" pkgs.system76-power; # Added 2024-10-16
610 system76-scheduler = lib.warn "kernelPackages.system76-scheduler is now pkgs.system76-scheduler" pkgs.system76-scheduler; # Added 2024-10-16
613 hardenedPackagesFor = kernel: overrides: packagesFor (hardenedKernelFor kernel overrides);
616 # recurse to build modules for the kernels
617 linux_5_4 = recurseIntoAttrs (packagesFor kernels.linux_5_4);
618 linux_5_10 = recurseIntoAttrs (packagesFor kernels.linux_5_10);
619 linux_5_15 = recurseIntoAttrs (packagesFor kernels.linux_5_15);
620 linux_6_1 = recurseIntoAttrs (packagesFor kernels.linux_6_1);
621 linux_6_6 = recurseIntoAttrs (packagesFor kernels.linux_6_6);
622 linux_6_10 = recurseIntoAttrs (packagesFor kernels.linux_6_10);
623 linux_6_11 = recurseIntoAttrs (packagesFor kernels.linux_6_11);
624 } // lib.optionalAttrs config.allowAliases {
625 linux_4_14 = throw "linux 4.14 was removed because it will reach its end of life within 23.11"; # Added 2023-10-11
626 linux_4_19 = throw "linux 4.19 was removed because it will reach its end of life within 24.11"; # Added 2024-09-21
627 linux_6_4 = throw "linux 6.4 was removed because it reached its end of life upstream"; # Added 2023-10-02
628 linux_6_5 = throw "linux 6.5 was removed because it reached its end of life upstream"; # Added 2024-02-28
629 linux_6_7 = throw "linux 6.7 was removed because it reached its end of life upstream"; # Added 2024-04-04
630 linux_6_8 = throw "linux 6.8 was removed because it reached its end of life upstream"; # Added 2024-08-02
631 linux_6_9 = throw "linux 6.9 was removed because it reached its end of life upstream"; # Added 2024-08-02
635 # realtime kernel packages
636 linux_rt_5_4 = packagesFor kernels.linux_rt_5_4;
637 linux_rt_5_10 = packagesFor kernels.linux_rt_5_10;
638 linux_rt_5_15 = packagesFor kernels.linux_rt_5_15;
639 linux_rt_6_1 = packagesFor kernels.linux_rt_6_1;
640 linux_rt_6_6 = packagesFor kernels.linux_rt_6_6;
644 linux_rpi1 = packagesFor kernels.linux_rpi1;
645 linux_rpi2 = packagesFor kernels.linux_rpi2;
646 linux_rpi3 = packagesFor kernels.linux_rpi3;
647 linux_rpi4 = packagesFor kernels.linux_rpi4;
650 packages = recurseIntoAttrs (vanillaPackages // rtPackages // rpiPackages // {
652 # Intentionally lacks recurseIntoAttrs, as -rc kernels will quite likely break out-of-tree modules and cause failed Hydra builds.
653 linux_testing = packagesFor kernels.linux_testing;
655 linux_hardened = recurseIntoAttrs (packagesFor kernels.linux_hardened);
657 linux_5_4_hardened = recurseIntoAttrs (packagesFor kernels.linux_5_4_hardened);
658 linux_5_10_hardened = recurseIntoAttrs (packagesFor kernels.linux_5_10_hardened);
659 linux_5_15_hardened = recurseIntoAttrs (packagesFor kernels.linux_5_15_hardened);
660 linux_6_1_hardened = recurseIntoAttrs (packagesFor kernels.linux_6_1_hardened);
661 linux_6_6_hardened = recurseIntoAttrs (packagesFor kernels.linux_6_6_hardened);
663 linux_zen = recurseIntoAttrs (packagesFor kernels.linux_zen);
664 linux_lqx = recurseIntoAttrs (packagesFor kernels.linux_lqx);
665 linux_xanmod = recurseIntoAttrs (packagesFor kernels.linux_xanmod);
666 linux_xanmod_stable = recurseIntoAttrs (packagesFor kernels.linux_xanmod_stable);
667 linux_xanmod_latest = recurseIntoAttrs (packagesFor kernels.linux_xanmod_latest);
669 linux_libre = recurseIntoAttrs (packagesFor kernels.linux_libre);
671 linux_latest_libre = recurseIntoAttrs (packagesFor kernels.linux_latest_libre);
672 __recurseIntoDerivationForReleaseJobs = true;
673 } // lib.optionalAttrs config.allowAliases {
674 linux_4_14_hardened = throw "linux 4.14 was removed because it will reach its end of life within 23.11";
675 linux_4_19_hardened = throw "linux 4.19 was removed because it will reach its end of life within 24.11";
676 linux_6_4_hardened = throw "linux 6.4 was removed because it has reached its end of life upstream";
677 linux_6_5_hardened = throw "linux 6.5 was removed because it has reached its end of life upstream";
678 linux_6_7_hardened = throw "linux 6.7 was removed because it has reached its end of life upstream";
679 linux_6_8_hardened = throw "linux 6.8 was removed because it has reached its end of life upstream";
680 linux_6_9_hardened = throw "linux 6.9 was removed because it has reached its end of life upstream";
681 linux_xanmod_tt = throw "linux_xanmod_tt was removed because upstream no longer offers this option";
685 linux_default = packages.linux_6_6;
686 # Update this when adding the newest kernel major version!
687 linux_latest = packages.linux_6_11;
688 linux_mptcp = throw "'linux_mptcp' has been moved to https://github.com/teto/mptcp-flake";
689 linux_rt_default = packages.linux_rt_5_15;
690 linux_rt_latest = packages.linux_rt_6_6;
693 manualConfig = callPackage ../os-specific/linux/kernel/manual-config.nix {};
695 customPackage = { version, src, modDirVersion ? lib.versions.pad 3 version, configfile, allowImportFromDerivation ? true }:
696 recurseIntoAttrs (packagesFor (manualConfig {
697 inherit version src modDirVersion configfile allowImportFromDerivation;
700 # Derive one of the default .config files
704 version ? (builtins.parseDrvName src.name).version,
705 makeTarget ? "defconfig",
706 name ? "kernel.config",
707 }: stdenvNoCC.mkDerivation {
709 depsBuildBuild = [ buildPackages.stdenv.cc ]
710 ++ lib.optionals (lib.versionAtLeast version "4.16") [ buildPackages.bison buildPackages.flex ];
711 patches = map (p: p.patch) kernelPatches; # Patches may include new configs.
713 patchShebangs scripts/
718 ARCH=${stdenv.hostPlatform.linuxArch} \
719 HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc \
727 buildLinux = callPackage ../os-specific/linux/kernel/generic.nix {};