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 {
30 hardenedKernelFor = kernel': overrides:
32 kernel = kernel'.override overrides;
33 version = kernelPatches.hardened.${kernel.meta.branch}.version;
34 major = lib.versions.major version;
35 sha256 = kernelPatches.hardened.${kernel.meta.branch}.sha256;
36 modDirVersion' = builtins.replaceStrings [ kernel.version ] [ version ] kernel.modDirVersion;
38 structuredExtraConfig = import ../os-specific/linux/kernel/hardened/config.nix {
39 inherit stdenv lib version;
43 modDirVersion = modDirVersion' + kernelPatches.hardened.${kernel.meta.branch}.extra;
45 url = "mirror://kernel/linux/kernel/v${major}.x/linux-${version}.tar.xz";
49 broken = kernel.meta.broken;
52 kernelPatches = kernel.kernelPatches ++ [
53 kernelPatches.hardened.${kernel.meta.branch}
58 kernelPatches = callPackage ../os-specific/linux/kernel/patches.nix { };
60 kernels = recurseIntoAttrs (lib.makeExtensible (self: with self;
61 let callPackage = newScope self; in {
63 # NOTE: PLEASE DO NOT ADD NEW VENDOR KERNELS TO NIXPKGS.
64 # New vendor kernels should go to nixos-hardware instead.
65 # e.g. https://github.com/NixOS/nixos-hardware/tree/master/microsoft/surface/kernel
67 linux_rpi1 = callPackage ../os-specific/linux/kernel/linux-rpi.nix {
68 kernelPatches = with kernelPatches; [
75 linux_rpi2 = callPackage ../os-specific/linux/kernel/linux-rpi.nix {
76 kernelPatches = with kernelPatches; [
83 linux_rpi3 = callPackage ../os-specific/linux/kernel/linux-rpi.nix {
84 kernelPatches = with kernelPatches; [
91 linux_rpi4 = callPackage ../os-specific/linux/kernel/linux-rpi.nix {
92 kernelPatches = with kernelPatches; [
99 linux_4_19 = callPackage ../os-specific/linux/kernel/mainline.nix {
102 [ kernelPatches.bridge_stp_helper
103 kernelPatches.request_key_helper
104 kernelPatches.modinst_arg_list_too_long
108 linux_5_4 = callPackage ../os-specific/linux/kernel/mainline.nix {
111 kernelPatches.bridge_stp_helper
112 kernelPatches.request_key_helper
113 kernelPatches.rtl8761b_support
117 linux_rt_5_4 = callPackage ../os-specific/linux/kernel/linux-rt-5.4.nix {
119 kernelPatches.bridge_stp_helper
120 kernelPatches.request_key_helper
124 linux_5_10 = callPackage ../os-specific/linux/kernel/mainline.nix {
127 kernelPatches.bridge_stp_helper
128 kernelPatches.request_key_helper
132 linux_rt_5_10 = callPackage ../os-specific/linux/kernel/linux-rt-5.10.nix {
134 kernelPatches.bridge_stp_helper
135 kernelPatches.request_key_helper
136 kernelPatches.export-rt-sched-migrate
140 linux_5_15 = callPackage ../os-specific/linux/kernel/mainline.nix {
143 kernelPatches.bridge_stp_helper
144 kernelPatches.request_key_helper
148 linux_rt_5_15 = callPackage ../os-specific/linux/kernel/linux-rt-5.15.nix {
150 kernelPatches.bridge_stp_helper
151 kernelPatches.request_key_helper
152 kernelPatches.export-rt-sched-migrate
156 linux_6_1 = callPackage ../os-specific/linux/kernel/mainline.nix {
159 kernelPatches.bridge_stp_helper
160 kernelPatches.request_key_helper
164 linux_rt_6_1 = callPackage ../os-specific/linux/kernel/linux-rt-6.1.nix {
166 kernelPatches.bridge_stp_helper
167 kernelPatches.request_key_helper
168 kernelPatches.export-rt-sched-migrate
169 kernelPatches.dell_xps_regression
173 linux_6_5 = callPackage ../os-specific/linux/kernel/mainline.nix {
176 kernelPatches.bridge_stp_helper
177 kernelPatches.request_key_helper
181 linux_6_6 = callPackage ../os-specific/linux/kernel/mainline.nix {
184 kernelPatches.bridge_stp_helper
185 kernelPatches.request_key_helper
190 testing = callPackage ../os-specific/linux/kernel/mainline.nix {
191 # A special branch that tracks the kernel under the release process
192 # i.e. which has at least a public rc1 and is not released yet.
195 kernelPatches.bridge_stp_helper
196 kernelPatches.request_key_helper
199 latest = packageAliases.linux_latest.kernel;
200 in if latest.kernelAtLeast testing.baseVersion
204 # FIXME: Remove after 23.11 is released
205 linux_testing_bcachefs = callPackage ../os-specific/linux/kernel/linux-testing-bcachefs.nix {
206 # Pinned on the last version which Kent's commits can be cleany rebased up.
208 kernelPatches = linux_6_5.kernelPatches;
211 # Using zenKernels like this due lqx&zen came from one source, but may have different base kernel version
212 # https://github.com/NixOS/nixpkgs/pull/161773#discussion_r820134708
213 zenKernels = callPackage ../os-specific/linux/kernel/zen-kernels.nix;
215 linux_zen = (zenKernels {
217 kernelPatches.bridge_stp_helper
218 kernelPatches.request_key_helper
222 linux_lqx = (zenKernels {
224 kernelPatches.bridge_stp_helper
225 kernelPatches.request_key_helper
229 # This contains the variants of the XanMod kernel
230 xanmodKernels = callPackage ../os-specific/linux/kernel/xanmod-kernels.nix {
232 kernelPatches.bridge_stp_helper
233 kernelPatches.request_key_helper
237 linux_xanmod = xanmodKernels.lts;
238 linux_xanmod_stable = xanmodKernels.main;
239 linux_xanmod_latest = xanmodKernels.main;
241 linux_libre = deblobKernel packageAliases.linux_default.kernel;
243 linux_latest_libre = deblobKernel packageAliases.linux_latest.kernel;
245 linux_hardened = hardenedKernelFor packageAliases.linux_default.kernel { };
247 linux_4_19_hardened = hardenedKernelFor kernels.linux_4_19 {
248 stdenv = gcc10Stdenv;
249 buildPackages = buildPackages // { stdenv = buildPackages.gcc10Stdenv; };
251 linux_5_4_hardened = hardenedKernelFor kernels.linux_5_4 {
252 stdenv = gcc10Stdenv;
253 buildPackages = buildPackages // { stdenv = buildPackages.gcc10Stdenv; };
255 linux_5_10_hardened = hardenedKernelFor kernels.linux_5_10 { };
256 linux_5_15_hardened = hardenedKernelFor kernels.linux_5_15 { };
257 linux_6_1_hardened = hardenedKernelFor kernels.linux_6_1 { };
258 linux_6_5_hardened = hardenedKernelFor kernels.linux_6_5 { };
260 } // lib.optionalAttrs config.allowAliases {
261 linux_4_9 = throw "linux 4.9 was removed because it will reach its end of life within 22.11";
262 linux_4_14 = throw "linux 4.14 was removed because it will reach its end of life within 23.11";
263 linux_5_18 = throw "linux 5.18 was removed because it has reached its end of life upstream";
264 linux_5_19 = throw "linux 5.19 was removed because it has reached its end of life upstream";
265 linux_6_0 = throw "linux 6.0 was removed because it has reached its end of life upstream";
266 linux_6_2 = throw "linux 6.2 was removed because it has reached its end of life upstream";
267 linux_6_3 = throw "linux 6.3 was removed because it has reached its end of life upstream";
268 linux_6_4 = throw "linux 6.4 was removed because it has reached its end of life upstream";
270 linux_xanmod_tt = throw "linux_xanmod_tt was removed because upstream no longer offers this option";
272 linux_5_18_hardened = throw "linux 5.18 was removed because it has reached its end of life upstream";
273 linux_5_19_hardened = throw "linux 5.19 was removed because it has reached its end of life upstream";
274 linux_6_0_hardened = throw "linux 6.0 was removed because it has reached its end of life upstream";
276 /* Linux kernel modules are inherently tied to a specific kernel. So
277 rather than provide specific instances of those packages for a
278 specific kernel, we have a function that builds those packages
279 for a specific kernel. This function can then be called for
280 whatever kernel you're using. */
282 packagesFor = kernel_: lib.makeExtensible (self: with self;
283 let callPackage = newScope self; in {
286 inherit (kernel) stdenv; # in particular, use the same compiler by default
288 # to help determine module compatibility
289 inherit (kernel) isZen isHardened isLibre;
290 inherit (kernel) kernelOlder kernelAtLeast;
291 # Obsolete aliases (these packages do not depend on the kernel).
292 inherit (pkgs) odp-dpdk pktgen; # added 2018-05
293 inherit (pkgs) bcc bpftrace; # added 2021-12
294 inherit (pkgs) oci-seccomp-bpf-hook; # added 2022-11
296 acpi_call = callPackage ../os-specific/linux/acpi-call {};
298 akvcam = callPackage ../os-specific/linux/akvcam { };
300 amdgpu-pro = callPackage ../os-specific/linux/amdgpu-pro {
301 libffi = pkgs.libffi.overrideAttrs (orig: rec {
304 url = "https://github.com/libffi/libffi/releases/download/v${version}/${orig.pname}-${version}.tar.gz";
305 sha256 = "0mi0cpf8aa40ljjmzxb7im6dbj45bb0kllcd09xgmp834y9agyvj";
310 apfs = callPackage ../os-specific/linux/apfs { };
312 ax99100 = callPackage ../os-specific/linux/ax99100 {};
314 batman_adv = callPackage ../os-specific/linux/batman-adv {};
316 bbswitch = callPackage ../os-specific/linux/bbswitch {};
318 ch9344 = callPackage ../os-specific/linux/ch9344 { };
320 chipsec = callPackage ../tools/security/chipsec {
325 cryptodev = callPackage ../os-specific/linux/cryptodev { };
327 cpupower = callPackage ../os-specific/linux/cpupower { };
329 ddcci-driver = callPackage ../os-specific/linux/ddcci { };
331 dddvb = callPackage ../os-specific/linux/dddvb { };
333 decklink = callPackage ../os-specific/linux/decklink { };
335 digimend = callPackage ../os-specific/linux/digimend { };
337 dpdk-kmods = callPackage ../os-specific/linux/dpdk-kmods { };
339 dpdk = pkgs.dpdk.override { inherit kernel; };
341 exfat-nofuse = if lib.versionOlder kernel.version "5.8" then callPackage ../os-specific/linux/exfat { } else null;
343 evdi = callPackage ../os-specific/linux/evdi { };
345 fanout = callPackage ../os-specific/linux/fanout { };
347 fwts-efi-runtime = callPackage ../os-specific/linux/fwts/module.nix { };
349 gcadapter-oc-kmod = callPackage ../os-specific/linux/gcadapter-oc-kmod { };
351 hyperv-daemons = callPackage ../os-specific/linux/hyperv-daemons { };
353 e1000e = if lib.versionOlder kernel.version "4.10" then callPackage ../os-specific/linux/e1000e {} else null;
355 intel-speed-select = if lib.versionAtLeast kernel.version "5.3" then callPackage ../os-specific/linux/intel-speed-select { } else null;
357 ipu6-drivers = callPackage ../os-specific/linux/ipu6-drivers {};
359 ivsc-driver = callPackage ../os-specific/linux/ivsc-driver {};
361 ixgbevf = callPackage ../os-specific/linux/ixgbevf {};
363 it87 = callPackage ../os-specific/linux/it87 {};
365 asus-ec-sensors = callPackage ../os-specific/linux/asus-ec-sensors {};
367 asus-wmi-sensors = callPackage ../os-specific/linux/asus-wmi-sensors {};
369 ena = callPackage ../os-specific/linux/ena {};
371 kvdo = callPackage ../os-specific/linux/kvdo {};
373 lenovo-legion-module = callPackage ../os-specific/linux/lenovo-legion { };
375 linux-gpib = callPackage ../applications/science/electronics/linux-gpib/kernel.nix { };
377 liquidtux = callPackage ../os-specific/linux/liquidtux {};
379 lkrg = callPackage ../os-specific/linux/lkrg {};
381 v4l2loopback = callPackage ../os-specific/linux/v4l2loopback { };
383 lttng-modules = callPackage ../os-specific/linux/lttng-modules { };
385 mstflint_access = callPackage ../os-specific/linux/mstflint_access { };
387 broadcom_sta = callPackage ../os-specific/linux/broadcom-sta { };
389 tbs = callPackage ../os-specific/linux/tbs { };
391 mbp2018-bridge-drv = callPackage ../os-specific/linux/mbp-modules/mbp2018-bridge-drv { };
393 nct6687d = callPackage ../os-specific/linux/nct6687d { };
395 new-lg4ff = callPackage ../os-specific/linux/new-lg4ff { };
397 nvidiabl = callPackage ../os-specific/linux/nvidiabl { };
399 nvidiaPackages = dontRecurseIntoAttrs (lib.makeExtensible (_: callPackage ../os-specific/linux/nvidia-x11 { }));
401 nvidia_x11 = nvidiaPackages.stable;
402 nvidia_x11_beta = nvidiaPackages.beta;
403 nvidia_x11_legacy340 = nvidiaPackages.legacy_340;
404 nvidia_x11_legacy390 = nvidiaPackages.legacy_390;
405 nvidia_x11_legacy470 = nvidiaPackages.legacy_470;
406 nvidia_x11_production = nvidiaPackages.production;
407 nvidia_x11_vulkan_beta = nvidiaPackages.vulkan_beta;
408 nvidia_dc = nvidiaPackages.dc;
409 nvidia_dc_520 = nvidiaPackages.dc_520;
411 # this is not a replacement for nvidia_x11*
412 # only the opensource kernel driver exposed for hydra to build
413 nvidia_x11_beta_open = nvidiaPackages.beta.open;
414 nvidia_x11_production_open = nvidiaPackages.production.open;
415 nvidia_x11_stable_open = nvidiaPackages.stable.open;
416 nvidia_x11_vulkan_beta_open = nvidiaPackages.vulkan_beta.open;
418 openrazer = callPackage ../os-specific/linux/openrazer/driver.nix { };
420 ply = callPackage ../os-specific/linux/ply { };
422 r8125 = callPackage ../os-specific/linux/r8125 { };
424 r8168 = callPackage ../os-specific/linux/r8168 { };
426 rtl8188eus-aircrack = callPackage ../os-specific/linux/rtl8188eus-aircrack { };
428 rtl8192eu = callPackage ../os-specific/linux/rtl8192eu { };
430 rtl8189es = callPackage ../os-specific/linux/rtl8189es { };
432 rtl8189fs = callPackage ../os-specific/linux/rtl8189fs { };
434 rtl8723ds = callPackage ../os-specific/linux/rtl8723ds { };
436 rtl8812au = callPackage ../os-specific/linux/rtl8812au { };
438 rtl8814au = callPackage ../os-specific/linux/rtl8814au { };
440 rtl88xxau-aircrack = callPackage ../os-specific/linux/rtl88xxau-aircrack {};
442 rtl8821au = callPackage ../os-specific/linux/rtl8821au { };
444 rtl8821ce = callPackage ../os-specific/linux/rtl8821ce { };
446 rtl88x2bu = callPackage ../os-specific/linux/rtl88x2bu { };
448 rtl8821cu = callPackage ../os-specific/linux/rtl8821cu { };
450 rtw88 = callPackage ../os-specific/linux/rtw88 { };
452 rtw89 = if lib.versionOlder kernel.version "5.16" then callPackage ../os-specific/linux/rtw89 { } else null;
454 openafs_1_8 = callPackage ../servers/openafs/1.8/module.nix { };
455 # Current stable release; don't backport release updates!
456 openafs = openafs_1_8;
458 opensnitch-ebpf = if lib.versionAtLeast kernel.version "5.10" then callPackage ../os-specific/linux/opensnitch-ebpf { } else null;
460 facetimehd = callPackage ../os-specific/linux/facetimehd { };
462 tuxedo-keyboard = if lib.versionAtLeast kernel.version "4.14" then callPackage ../os-specific/linux/tuxedo-keyboard { } else null;
464 jool = callPackage ../os-specific/linux/jool { };
466 kvmfr = callPackage ../os-specific/linux/kvmfr { };
468 mba6x_bl = callPackage ../os-specific/linux/mba6x_bl { };
470 mwprocapture = callPackage ../os-specific/linux/mwprocapture { };
472 mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { };
474 # compiles but has to be integrated into the kernel somehow
475 # Let's have it uncommented and finish it..
476 ndiswrapper = callPackage ../os-specific/linux/ndiswrapper { };
478 netatop = callPackage ../os-specific/linux/netatop { };
480 perf = callPackage ../os-specific/linux/kernel/perf { };
482 phc-intel = if lib.versionAtLeast kernel.version "4.10" then callPackage ../os-specific/linux/phc-intel { } else null;
484 prl-tools = callPackage ../os-specific/linux/prl-tools { };
486 isgx = callPackage ../os-specific/linux/isgx { };
488 rr-zen_workaround = callPackage ../development/tools/analysis/rr/zen_workaround.nix { };
490 sysdig = callPackage ../os-specific/linux/sysdig {};
492 systemtap = callPackage ../development/tools/profiling/systemtap { };
494 system76 = callPackage ../os-specific/linux/system76 { };
496 system76-acpi = callPackage ../os-specific/linux/system76-acpi { };
498 system76-power = callPackage ../os-specific/linux/system76-power { };
500 system76-io = callPackage ../os-specific/linux/system76-io { };
502 system76-scheduler = callPackage ../os-specific/linux/system76-scheduler { };
504 tmon = callPackage ../os-specific/linux/tmon { };
506 tp_smapi = callPackage ../os-specific/linux/tp_smapi { };
508 turbostat = callPackage ../os-specific/linux/turbostat { };
510 trelay = callPackage ../os-specific/linux/trelay { };
512 usbip = callPackage ../os-specific/linux/usbip { };
514 v86d = callPackage ../os-specific/linux/v86d { };
516 veikk-linux-driver = callPackage ../os-specific/linux/veikk-linux-driver { };
517 vendor-reset = callPackage ../os-specific/linux/vendor-reset { };
519 vhba = callPackage ../applications/emulators/cdemu/vhba.nix { };
521 virtio_vmmci = callPackage ../os-specific/linux/virtio_vmmci { };
523 virtualbox = callPackage ../os-specific/linux/virtualbox {
524 virtualbox = pkgs.virtualboxHardened;
527 virtualboxGuestAdditions = callPackage ../applications/virtualization/virtualbox/guest-additions {
528 virtualbox = pkgs.virtualboxHardened;
531 vm-tools = callPackage ../os-specific/linux/vm-tools { };
533 vmm_clock = callPackage ../os-specific/linux/vmm_clock { };
535 vmware = callPackage ../os-specific/linux/vmware { };
537 wireguard = if lib.versionOlder kernel.version "5.6" then callPackage ../os-specific/linux/wireguard { } else null;
539 x86_energy_perf_policy = callPackage ../os-specific/linux/x86_energy_perf_policy { };
541 xone = if lib.versionAtLeast kernel.version "5.4" then callPackage ../os-specific/linux/xone { } else null;
543 xpadneo = callPackage ../os-specific/linux/xpadneo { };
545 ithc = callPackage ../os-specific/linux/ithc { };
547 zenpower = callPackage ../os-specific/linux/zenpower { };
549 zfsStable = callPackage ../os-specific/linux/zfs/stable.nix {
550 configFile = "kernel";
553 zfsUnstable = callPackage ../os-specific/linux/zfs/unstable.nix {
554 configFile = "kernel";
559 can-isotp = callPackage ../os-specific/linux/can-isotp { };
561 qc71_laptop = callPackage ../os-specific/linux/qc71_laptop { };
563 hid-ite8291r3 = callPackage ../os-specific/linux/hid-ite8291r3 { };
565 hid-tmff2 = callPackage ../os-specific/linux/hid-tmff2 { };
567 } // lib.optionalAttrs config.allowAliases {
568 ati_drivers_x11 = throw "ati drivers are no longer supported by any kernel >=4.1"; # added 2021-05-18;
569 hid-nintendo = throw "hid-nintendo was added in mainline kernel version 5.16"; # Added 2023-07-30
570 sch_cake = throw "sch_cake was added in mainline kernel version 4.19"; # Added 2023-06-14
571 rtl8723bs = throw "rtl8723bs was added in mainline kernel version 4.12"; # Added 2023-06-14
572 xmm7360-pci = throw "Support for the XMM7360 WWAN card was added to the iosm kmod in mainline kernel version 5.18";
575 hardenedPackagesFor = kernel: overrides: packagesFor (hardenedKernelFor kernel overrides);
578 # recurse to build modules for the kernels
579 linux_4_19 = recurseIntoAttrs (packagesFor kernels.linux_4_19);
580 linux_5_4 = recurseIntoAttrs (packagesFor kernels.linux_5_4);
581 linux_5_10 = recurseIntoAttrs (packagesFor kernels.linux_5_10);
582 linux_5_15 = recurseIntoAttrs (packagesFor kernels.linux_5_15);
583 linux_6_1 = recurseIntoAttrs (packagesFor kernels.linux_6_1);
584 linux_6_5 = recurseIntoAttrs (packagesFor kernels.linux_6_5);
585 linux_6_6 = recurseIntoAttrs (packagesFor kernels.linux_6_6);
586 } // lib.optionalAttrs config.allowAliases {
587 linux_4_9 = throw "linux 4.9 was removed because it will reach its end of life within 22.11"; # Added 2022-11-08
588 linux_4_14 = throw "linux 4.14 was removed because it will reach its end of life within 23.11"; # Added 2023-10-11
589 linux_5_18 = throw "linux 5.18 was removed because it reached its end of life upstream"; # Added 2022-09-17
590 linux_5_19 = throw "linux 5.19 was removed because it reached its end of life upstream"; # Added 2022-11-01
591 linux_6_0 = throw "linux 6.0 was removed because it reached its end of life upstream"; # Added 2023-01-20
592 linux_6_2 = throw "linux 6.2 was removed because it reached its end of life upstream"; # Added 2023-05-26
593 linux_6_3 = throw "linux 6.3 was removed because it reached its end of life upstream"; # Added 2023-07-22
594 linux_6_4 = throw "linux 6.4 was removed because it reached its end of life upstream"; # Added 2023-10-02
598 # realtime kernel packages
599 linux_rt_5_4 = packagesFor kernels.linux_rt_5_4;
600 linux_rt_5_10 = packagesFor kernels.linux_rt_5_10;
601 linux_rt_5_15 = packagesFor kernels.linux_rt_5_15;
602 linux_rt_6_1 = packagesFor kernels.linux_rt_6_1;
606 linux_rpi1 = packagesFor kernels.linux_rpi1;
607 linux_rpi2 = packagesFor kernels.linux_rpi2;
608 linux_rpi3 = packagesFor kernels.linux_rpi3;
609 linux_rpi4 = packagesFor kernels.linux_rpi4;
612 packages = recurseIntoAttrs (vanillaPackages // rtPackages // rpiPackages // {
614 # Intentionally lacks recurseIntoAttrs, as -rc kernels will quite likely break out-of-tree modules and cause failed Hydra builds.
615 linux_testing = packagesFor kernels.linux_testing;
616 # FIXME: Remove after 23.11 is released
617 linux_testing_bcachefs = recurseIntoAttrs (packagesFor kernels.linux_testing_bcachefs);
619 linux_hardened = recurseIntoAttrs (packagesFor kernels.linux_hardened);
621 linux_4_19_hardened = recurseIntoAttrs (packagesFor kernels.linux_4_19_hardened);
622 linux_5_4_hardened = recurseIntoAttrs (packagesFor kernels.linux_5_4_hardened);
623 linux_5_10_hardened = recurseIntoAttrs (packagesFor kernels.linux_5_10_hardened);
624 linux_5_15_hardened = recurseIntoAttrs (packagesFor kernels.linux_5_15_hardened);
625 linux_6_1_hardened = recurseIntoAttrs (packagesFor kernels.linux_6_1_hardened);
626 linux_6_5_hardened = recurseIntoAttrs (packagesFor kernels.linux_6_5_hardened);
628 linux_zen = recurseIntoAttrs (packagesFor kernels.linux_zen);
629 linux_lqx = recurseIntoAttrs (packagesFor kernels.linux_lqx);
630 linux_xanmod = recurseIntoAttrs (packagesFor kernels.linux_xanmod);
631 linux_xanmod_stable = recurseIntoAttrs (packagesFor kernels.linux_xanmod_stable);
632 linux_xanmod_latest = recurseIntoAttrs (packagesFor kernels.linux_xanmod_latest);
634 linux_libre = recurseIntoAttrs (packagesFor kernels.linux_libre);
636 linux_latest_libre = recurseIntoAttrs (packagesFor kernels.linux_latest_libre);
637 } // lib.optionalAttrs config.allowAliases {
638 linux_5_18_hardened = throw "linux 5.18 was removed because it has reached its end of life upstream";
639 linux_5_19_hardened = throw "linux 5.19 was removed because it has reached its end of life upstream";
640 linux_6_0_hardened = throw "linux 6.0 was removed because it has reached its end of life upstream";
641 linux_xanmod_tt = throw "linux_xanmod_tt was removed because upstream no longer offers this option";
645 linux_default = packages.linux_6_1;
646 # Update this when adding the newest kernel major version!
647 linux_latest = packages.linux_6_6;
648 linux_mptcp = throw "'linux_mptcp' has been moved to https://github.com/teto/mptcp-flake";
649 linux_rt_default = packages.linux_rt_5_4;
650 linux_rt_latest = packages.linux_rt_6_1;
653 manualConfig = callPackage ../os-specific/linux/kernel/manual-config.nix {};
655 customPackage = { version, src, modDirVersion ? lib.versions.pad 3 version, configfile, allowImportFromDerivation ? true }:
656 recurseIntoAttrs (packagesFor (manualConfig {
657 inherit version src modDirVersion configfile allowImportFromDerivation;
660 # Derive one of the default .config files
664 version ? (builtins.parseDrvName src.name).version,
665 makeTarget ? "defconfig",
666 name ? "kernel.config",
667 }: stdenvNoCC.mkDerivation {
669 depsBuildBuild = [ buildPackages.stdenv.cc ]
670 ++ lib.optionals (lib.versionAtLeast version "4.16") [ buildPackages.bison buildPackages.flex ];
671 patches = map (p: p.patch) kernelPatches; # Patches may include new configs.
673 patchShebangs scripts/
678 ARCH=${stdenv.hostPlatform.linuxArch} \
679 HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc \
687 buildLinux = attrs: callPackage ../os-specific/linux/kernel/generic.nix attrs;