nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at haskell-updates 869 lines 34 kB view raw
1{ 2 pkgs, 3 linuxKernel, 4 kernelPackagesExtensions, 5 config, 6 buildPackages, 7 callPackage, 8 stdenv, 9 stdenvNoCC, 10 newScope, 11 lib, 12 fetchurl, 13}: 14 15# When adding a kernel: 16# - Update packageAliases.linux_latest to the latest version 17# - Update linux_latest_hardened when the patches become available 18 19let 20 inherit (lib) recurseIntoAttrs dontRecurseIntoAttrs; 21 inherit (linuxKernel) 22 kernels 23 kernelPatches 24 manualConfig 25 packages 26 packagesFor 27 packageAliases 28 vanillaPackages 29 rtPackages 30 rpiPackages 31 ; 32 33 markBroken = 34 drv: 35 drv.overrideAttrs ( 36 { 37 meta ? { }, 38 ... 39 }: 40 { 41 meta = meta // { 42 broken = true; 43 }; 44 } 45 ); 46 47 # Hardened Linux 48 hardenedKernelFor = 49 kernel': overrides: 50 let 51 kernel = kernel'.override overrides; 52 version = kernelPatches.hardened.${kernel.meta.branch}.version; 53 major = lib.versions.major version; 54 sha256 = kernelPatches.hardened.${kernel.meta.branch}.sha256; 55 modDirVersion' = builtins.replaceStrings [ kernel.version ] [ version ] kernel.modDirVersion; 56 in 57 kernel.override { 58 structuredExtraConfig = import ../os-specific/linux/kernel/hardened/config.nix { 59 inherit stdenv lib version; 60 }; 61 argsOverride = { 62 inherit version; 63 pname = "linux-hardened"; 64 modDirVersion = modDirVersion' + kernelPatches.hardened.${kernel.meta.branch}.extra; 65 src = fetchurl { 66 url = "mirror://kernel/linux/kernel/v${major}.x/linux-${version}.tar.xz"; 67 inherit sha256; 68 }; 69 extraMeta = { 70 broken = kernel.meta.broken; 71 }; 72 }; 73 kernelPatches = kernel.kernelPatches ++ [ 74 kernelPatches.hardened.${kernel.meta.branch} 75 ]; 76 isHardened = true; 77 }; 78in 79{ 80 kernelPatches = callPackage ../os-specific/linux/kernel/patches.nix { }; 81 82 kernels = recurseIntoAttrs ( 83 lib.makeExtensible ( 84 self: 85 with self; 86 let 87 callPackage = newScope self; 88 in 89 { 90 91 # NOTE: PLEASE DO NOT ADD NEW DOWNSTREAM KERNELS TO NIXPKGS. 92 # New vendor kernels should go to nixos-hardware instead. 93 # e.g. https://github.com/NixOS/nixos-hardware/tree/master/microsoft/surface/kernel 94 95 linux_rpi1 = callPackage ../os-specific/linux/kernel/linux-rpi.nix { 96 kernelPatches = with kernelPatches; [ 97 bridge_stp_helper 98 request_key_helper 99 ]; 100 rpiVersion = 1; 101 }; 102 103 linux_rpi2 = callPackage ../os-specific/linux/kernel/linux-rpi.nix { 104 kernelPatches = with kernelPatches; [ 105 bridge_stp_helper 106 request_key_helper 107 ]; 108 rpiVersion = 2; 109 }; 110 111 linux_rpi3 = callPackage ../os-specific/linux/kernel/linux-rpi.nix { 112 kernelPatches = with kernelPatches; [ 113 bridge_stp_helper 114 request_key_helper 115 ]; 116 rpiVersion = 3; 117 }; 118 119 linux_rpi4 = callPackage ../os-specific/linux/kernel/linux-rpi.nix { 120 kernelPatches = with kernelPatches; [ 121 bridge_stp_helper 122 request_key_helper 123 ]; 124 rpiVersion = 4; 125 }; 126 127 linux_5_10 = callPackage ../os-specific/linux/kernel/mainline.nix { 128 branch = "5.10"; 129 kernelPatches = [ 130 kernelPatches.bridge_stp_helper 131 kernelPatches.request_key_helper 132 ]; 133 }; 134 135 linux_rt_5_10 = callPackage ../os-specific/linux/kernel/linux-rt-5.10.nix { 136 kernelPatches = [ 137 kernelPatches.bridge_stp_helper 138 kernelPatches.request_key_helper 139 kernelPatches.export-rt-sched-migrate 140 ]; 141 }; 142 143 linux_5_15 = callPackage ../os-specific/linux/kernel/mainline.nix { 144 branch = "5.15"; 145 kernelPatches = [ 146 kernelPatches.bridge_stp_helper 147 kernelPatches.request_key_helper 148 ]; 149 }; 150 151 linux_rt_5_15 = callPackage ../os-specific/linux/kernel/linux-rt-5.15.nix { 152 kernelPatches = [ 153 kernelPatches.bridge_stp_helper 154 kernelPatches.request_key_helper 155 kernelPatches.export-rt-sched-migrate 156 ]; 157 }; 158 159 linux_6_1 = callPackage ../os-specific/linux/kernel/mainline.nix { 160 branch = "6.1"; 161 kernelPatches = [ 162 kernelPatches.bridge_stp_helper 163 kernelPatches.request_key_helper 164 ]; 165 }; 166 167 linux_rt_6_1 = callPackage ../os-specific/linux/kernel/linux-rt-6.1.nix { 168 kernelPatches = [ 169 kernelPatches.bridge_stp_helper 170 kernelPatches.request_key_helper 171 kernelPatches.export-rt-sched-migrate 172 ]; 173 }; 174 175 linux_6_6 = callPackage ../os-specific/linux/kernel/mainline.nix { 176 branch = "6.6"; 177 kernelPatches = [ 178 kernelPatches.bridge_stp_helper 179 kernelPatches.request_key_helper 180 ]; 181 }; 182 183 linux_rt_6_6 = callPackage ../os-specific/linux/kernel/linux-rt-6.6.nix { 184 kernelPatches = [ 185 kernelPatches.bridge_stp_helper 186 kernelPatches.request_key_helper 187 kernelPatches.export-rt-sched-migrate 188 ]; 189 }; 190 191 linux_6_12 = callPackage ../os-specific/linux/kernel/mainline.nix { 192 branch = "6.12"; 193 kernelPatches = [ 194 kernelPatches.bridge_stp_helper 195 kernelPatches.request_key_helper 196 ]; 197 }; 198 199 linux_6_18 = callPackage ../os-specific/linux/kernel/mainline.nix { 200 branch = "6.18"; 201 kernelPatches = [ 202 kernelPatches.bridge_stp_helper 203 kernelPatches.request_key_helper 204 ]; 205 }; 206 207 linux_6_19 = callPackage ../os-specific/linux/kernel/mainline.nix { 208 branch = "6.19"; 209 kernelPatches = [ 210 kernelPatches.bridge_stp_helper 211 kernelPatches.request_key_helper 212 ]; 213 }; 214 215 linux_testing = 216 let 217 testing = callPackage ../os-specific/linux/kernel/mainline.nix { 218 # A special branch that tracks the kernel under the release process 219 # i.e. which has at least a public rc1 and is not released yet. 220 branch = "testing"; 221 kernelPatches = [ 222 kernelPatches.bridge_stp_helper 223 kernelPatches.request_key_helper 224 ]; 225 }; 226 latest = packageAliases.linux_latest.kernel; 227 in 228 if latest.kernelAtLeast testing.baseVersion then latest else testing; 229 230 linux_default = packageAliases.linux_default.kernel; 231 232 linux_latest = packageAliases.linux_latest.kernel; 233 234 linux_zen = callPackage ../os-specific/linux/kernel/zen-kernels.nix { 235 kernelPatches = [ 236 kernelPatches.bridge_stp_helper 237 kernelPatches.request_key_helper 238 ]; 239 }; 240 241 # This contains the variants of the XanMod kernel 242 xanmodKernels = callPackage ../os-specific/linux/kernel/xanmod-kernels.nix; 243 244 linux_xanmod = xanmodKernels { 245 variant = "lts"; 246 kernelPatches = [ 247 kernelPatches.bridge_stp_helper 248 kernelPatches.request_key_helper 249 ]; 250 }; 251 linux_xanmod_stable = xanmodKernels { 252 variant = "main"; 253 kernelPatches = [ 254 kernelPatches.bridge_stp_helper 255 kernelPatches.request_key_helper 256 ]; 257 }; 258 linux_xanmod_latest = xanmodKernels { 259 variant = "main"; 260 kernelPatches = [ 261 kernelPatches.bridge_stp_helper 262 kernelPatches.request_key_helper 263 ]; 264 }; 265 266 linux_6_12_hardened = hardenedKernelFor kernels.linux_6_12 { }; 267 268 linux_hardened = linux_6_12_hardened; 269 } 270 // lib.optionalAttrs config.allowAliases { 271 linux_lqx = throw "linux_lqx has been removed due to lack of maintenance"; 272 linux_libre = throw "linux_libre has been removed due to lack of maintenance"; 273 linux_latest_libre = throw "linux_latest_libre has been removed due to lack of maintenance"; 274 275 linux_4_19 = throw "linux 4.19 was removed because it will reach its end of life within 24.11"; 276 linux_5_4 = throw "linux 5.4 was removed because it will reach its end of life within 25.11"; 277 linux_6_9 = throw "linux 6.9 was removed because it has reached its end of life upstream"; 278 linux_6_10 = throw "linux 6.10 was removed because it has reached its end of life upstream"; 279 linux_6_11 = throw "linux 6.11 was removed because it has reached its end of life upstream"; 280 linux_6_13 = throw "linux 6.13 was removed because it has reached its end of life upstream"; 281 linux_6_14 = throw "linux 6.14 was removed because it has reached its end of life upstream"; 282 linux_6_15 = throw "linux 6.15 was removed because it has reached its end of life upstream"; 283 linux_6_16 = throw "linux 6.16 was removed because it has reached its end of life upstream"; 284 linux_6_17 = throw "linux 6.17 was removed because it has reached its end of life upstream"; 285 286 linux_5_10_hardened = throw "linux_hardened on nixpkgs only contains latest stable and latest LTS"; 287 linux_5_15_hardened = throw "linux_hardened on nixpkgs only contains latest stable and latest LTS"; 288 linux_6_1_hardened = throw "linux_hardened on nixpkgs only contains latest stable and latest LTS"; 289 linux_6_6_hardened = throw "linux_hardened on nixpkgs only contains latest stable and latest LTS"; 290 291 linux_4_19_hardened = throw "linux 4.19 was removed because it will reach its end of life within 24.11"; 292 linux_5_4_hardened = throw "linux_5_4_hardened was removed because it was broken"; 293 linux_6_9_hardened = throw "linux 6.9 was removed because it has reached its end of life upstream"; 294 linux_6_10_hardened = throw "linux 6.10 was removed because it has reached its end of life upstream"; 295 linux_6_11_hardened = throw "linux 6.11 was removed because it has reached its end of life upstream"; 296 linux_6_13_hardened = throw "linux 6.13 was removed because it has reached its end of life upstream"; 297 linux_6_14_hardened = throw "linux 6.14 was removed because it has reached its end of life upstream"; 298 linux_6_15_hardened = throw "linux 6.15 was removed because it has reached its end of life upstream"; 299 300 linux_rt_5_4 = throw "linux_rt 5.4 has been removed because it will reach its end of life within 25.11"; 301 302 linux_ham = throw "linux_ham has been removed in favour of the standard kernel packages"; 303 } 304 ) 305 ); 306 /* 307 Linux kernel modules are inherently tied to a specific kernel. So 308 rather than provide specific instances of those packages for a 309 specific kernel, we have a function that builds those packages 310 for a specific kernel. This function can then be called for 311 whatever kernel you're using. 312 */ 313 314 packagesFor = 315 kernel_: 316 (lib.makeExtensible ( 317 self: 318 with self; 319 let 320 callPackage = newScope self; 321 in 322 { 323 inherit callPackage; 324 kernel = kernel_; 325 inherit (kernel) stdenv; # in particular, use the same compiler by default 326 327 # to help determine module compatibility 328 inherit (kernel) 329 isLTS 330 isZen 331 isHardened 332 ; 333 inherit (kernel) kernelOlder kernelAtLeast; 334 kernelModuleMakeFlags = self.kernel.commonMakeFlags ++ [ 335 "KBUILD_OUTPUT=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" 336 ]; 337 # Obsolete aliases (these packages do not depend on the kernel). 338 inherit (pkgs) odp-dpdk pktgen; # added 2018-05 339 inherit (pkgs) bcc bpftrace; # added 2021-12 340 inherit (pkgs) oci-seccomp-bpf-hook; # added 2022-11 341 inherit (pkgs) dpdk; # added 2024-03 342 343 acer-wmi-battery = callPackage ../os-specific/linux/acer-wmi-battery { }; 344 345 acpi_call = callPackage ../os-specific/linux/acpi-call { }; 346 347 ajantv2 = callPackage ../os-specific/linux/ajantv2 { }; 348 349 akvcam = callPackage ../os-specific/linux/akvcam { }; 350 351 amdgpu-i2c = callPackage ../os-specific/linux/amdgpu-i2c { }; 352 353 amneziawg = callPackage ../os-specific/linux/amneziawg { }; 354 355 apfs = callPackage ../os-specific/linux/apfs { }; 356 357 ax99100 = callPackage ../os-specific/linux/ax99100 { }; 358 359 batman_adv = callPackage ../os-specific/linux/batman-adv { }; 360 361 bbswitch = callPackage ../os-specific/linux/bbswitch { }; 362 363 # NOTE: The bcachefs module is called this way to facilitate 364 # easy overriding, as it is expected many users will want to 365 # pull from the upstream git repo, which may include 366 # unreleased changes to the module build process. 367 bcachefs = callPackage pkgs.bcachefs-tools.kernelModule { }; 368 369 ch9344 = callPackage ../os-specific/linux/ch9344 { }; 370 371 chipsec = callPackage ../by-name/ch/chipsec/package.nix { 372 inherit kernel; 373 withDriver = true; 374 }; 375 376 cryptodev = callPackage ../os-specific/linux/cryptodev { }; 377 378 cpupower = callPackage ../os-specific/linux/cpupower { }; 379 380 ddcci-driver = callPackage ../os-specific/linux/ddcci { }; 381 382 dddvb = callPackage ../os-specific/linux/dddvb { }; 383 384 decklink = callPackage ../os-specific/linux/decklink { }; 385 386 digimend = callPackage ../os-specific/linux/digimend { }; 387 388 dpdk-kmods = callPackage ../os-specific/linux/dpdk-kmods { }; 389 390 ecapture = callPackage ../by-name/ec/ecapture/package.nix { 391 withNonBTF = true; 392 inherit kernel; 393 }; 394 395 evdi = callPackage ../os-specific/linux/evdi { }; 396 397 fanout = callPackage ../os-specific/linux/fanout { }; 398 399 framework-laptop-kmod = callPackage ../os-specific/linux/framework-laptop-kmod { }; 400 401 fwts-efi-runtime = callPackage ../os-specific/linux/fwts/module.nix { }; 402 403 gasket = callPackage ../os-specific/linux/gasket { }; 404 405 gcadapter-oc-kmod = callPackage ../os-specific/linux/gcadapter-oc-kmod { }; 406 407 hyperv-daemons = callPackage ../os-specific/linux/hyperv-daemons { }; 408 409 e1000e = 410 if lib.versionOlder kernel.version "4.10" then 411 callPackage ../os-specific/linux/e1000e { } 412 else 413 null; 414 415 iio-utils = 416 if lib.versionAtLeast kernel.version "4.1" then 417 callPackage ../os-specific/linux/iio-utils { } 418 else 419 null; 420 421 intel-speed-select = 422 if lib.versionAtLeast kernel.version "5.3" then 423 callPackage ../os-specific/linux/intel-speed-select { } 424 else 425 null; 426 427 ipu6-drivers = callPackage ../os-specific/linux/ipu6-drivers { }; 428 429 ivsc-driver = callPackage ../os-specific/linux/ivsc-driver { }; 430 431 ixgbevf = callPackage ../os-specific/linux/ixgbevf { }; 432 433 it87 = callPackage ../os-specific/linux/it87 { }; 434 435 asus-ec-sensors = callPackage ../os-specific/linux/asus-ec-sensors { }; 436 437 ena = callPackage ../os-specific/linux/ena { }; 438 439 lenovo-legion-module = callPackage ../os-specific/linux/lenovo-legion { }; 440 441 linux-gpib = callPackage ../applications/science/electronics/linux-gpib/kernel.nix { }; 442 443 liquidtux = callPackage ../os-specific/linux/liquidtux { }; 444 445 lkrg = callPackage ../os-specific/linux/lkrg { }; 446 447 v4l2loopback = callPackage ../os-specific/linux/v4l2loopback { }; 448 449 lttng-modules = callPackage ../os-specific/linux/lttng-modules { }; 450 451 mstflint_access = callPackage ../os-specific/linux/mstflint_access { }; 452 453 broadcom_sta = callPackage ../os-specific/linux/broadcom-sta { }; 454 455 tbs = callPackage ../os-specific/linux/tbs { }; 456 457 mbp2018-bridge-drv = callPackage ../os-specific/linux/mbp-modules/mbp2018-bridge-drv { }; 458 459 nct6687d = callPackage ../os-specific/linux/nct6687d { }; 460 461 hid-fanatecff = callPackage ../os-specific/linux/hid-fanatecff { }; 462 463 new-lg4ff = callPackage ../os-specific/linux/new-lg4ff { }; 464 465 zenergy = callPackage ../os-specific/linux/zenergy { }; 466 467 nvidiabl = callPackage ../os-specific/linux/nvidiabl { }; 468 469 nvidiaPackages = dontRecurseIntoAttrs ( 470 lib.makeExtensible (_: callPackage ../os-specific/linux/nvidia-x11 { }) 471 ); 472 473 nvidia_x11 = nvidiaPackages.stable; 474 nvidia_x11_beta = nvidiaPackages.beta; 475 nvidia_x11_latest = nvidiaPackages.latest; 476 nvidia_x11_legacy340 = nvidiaPackages.legacy_340; 477 nvidia_x11_legacy390 = nvidiaPackages.legacy_390; 478 nvidia_x11_legacy470 = nvidiaPackages.legacy_470; 479 nvidia_x11_legacy535 = nvidiaPackages.legacy_535; 480 nvidia_x11_production = nvidiaPackages.production; 481 nvidia_x11_vulkan_beta = nvidiaPackages.vulkan_beta; 482 nvidia_dc = nvidiaPackages.dc; 483 484 # this is not a replacement for nvidia_x11* 485 # only the opensource kernel driver exposed for hydra to build 486 nvidia_x11_beta_open = nvidiaPackages.beta.open; 487 nvidia_x11_latest_open = nvidiaPackages.latest.open; 488 nvidia_x11_production_open = nvidiaPackages.production.open; 489 nvidia_x11_stable_open = nvidiaPackages.stable.open; 490 nvidia_x11_vulkan_beta_open = nvidiaPackages.vulkan_beta.open; 491 492 nxp-pn5xx = callPackage ../os-specific/linux/nxp-pn5xx { }; 493 494 openrazer = callPackage ../os-specific/linux/openrazer/driver.nix { }; 495 496 ply = callPackage ../os-specific/linux/ply { }; 497 498 r8125 = callPackage ../os-specific/linux/r8125 { }; 499 500 r8168 = callPackage ../os-specific/linux/r8168 { }; 501 502 rtl8188eus-aircrack = callPackage ../os-specific/linux/rtl8188eus-aircrack { }; 503 504 rtl8192eu = callPackage ../os-specific/linux/rtl8192eu { }; 505 506 rtl8189es = callPackage ../os-specific/linux/rtl8189es { }; 507 508 rtl8189fs = callPackage ../os-specific/linux/rtl8189fs { }; 509 510 rtl8723ds = callPackage ../os-specific/linux/rtl8723ds { }; 511 512 rtl8812au = callPackage ../os-specific/linux/rtl8812au { }; 513 514 rtl8814au = callPackage ../os-specific/linux/rtl8814au { }; 515 516 rtl8852au = callPackage ../os-specific/linux/rtl8852au { }; 517 518 rtl8852bu = callPackage ../os-specific/linux/rtl8852bu { }; 519 520 rtl88xxau-aircrack = callPackage ../os-specific/linux/rtl88xxau-aircrack { }; 521 522 rtl8821au = callPackage ../os-specific/linux/rtl8821au { }; 523 524 rtl8821ce = callPackage ../os-specific/linux/rtl8821ce { }; 525 526 rtl88x2bu = callPackage ../os-specific/linux/rtl88x2bu { }; 527 528 rtl8821cu = callPackage ../os-specific/linux/rtl8821cu { }; 529 530 rtw88 = callPackage ../os-specific/linux/rtw88 { }; 531 532 rtw89 = 533 if lib.versionOlder kernel.version "5.16" then callPackage ../os-specific/linux/rtw89 { } else null; 534 535 openafs_1_8 = callPackage ../servers/openafs/1.8/module.nix { }; 536 # Current stable release; don't backport release updates! 537 openafs = openafs_1_8; 538 539 opensnitch-ebpf = 540 if lib.versionAtLeast kernel.version "5.10" then 541 callPackage ../os-specific/linux/opensnitch-ebpf { } 542 else 543 null; 544 545 facetimehd = callPackage ../os-specific/linux/facetimehd { }; 546 547 rust-out-of-tree-module = 548 if lib.versionAtLeast kernel.version "6.7" then 549 callPackage ../os-specific/linux/rust-out-of-tree-module { } 550 else 551 null; 552 553 tuxedo-drivers = 554 if lib.versionAtLeast kernel.version "4.14" then 555 callPackage ../os-specific/linux/tuxedo-drivers { } 556 else 557 null; 558 559 jool = callPackage ../os-specific/linux/jool { }; 560 561 kvmfr = callPackage ../os-specific/linux/kvmfr { }; 562 563 mba6x_bl = callPackage ../os-specific/linux/mba6x_bl { }; 564 565 mdio-netlink = callPackage ../os-specific/linux/mdio-netlink { }; 566 567 mwprocapture = callPackage ../os-specific/linux/mwprocapture { }; 568 569 mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { }; 570 571 morse-driver = callPackage ../os-specific/linux/morse-driver { }; 572 573 # compiles but has to be integrated into the kernel somehow 574 # Let's have it uncommented and finish it.. 575 ndiswrapper = callPackage ../os-specific/linux/ndiswrapper { }; 576 577 netatop = callPackage ../os-specific/linux/netatop { }; 578 579 isgx = callPackage ../os-specific/linux/isgx { }; 580 581 rr-zen_workaround = callPackage ../development/tools/analysis/rr/zen_workaround.nix { }; 582 583 sheep-net = callPackage ../os-specific/linux/sheep-net { }; 584 585 shufflecake = callPackage ../os-specific/linux/shufflecake { }; 586 587 sysdig = callPackage ../os-specific/linux/sysdig { }; 588 589 systemtap = callPackage ../development/tools/profiling/systemtap { }; 590 591 system76 = callPackage ../os-specific/linux/system76 { }; 592 593 system76-acpi = callPackage ../os-specific/linux/system76-acpi { }; 594 595 system76-io = callPackage ../os-specific/linux/system76-io { }; 596 597 tmon = callPackage ../os-specific/linux/tmon { }; 598 599 tp_smapi = callPackage ../os-specific/linux/tp_smapi { }; 600 601 tt-kmd = callPackage ../os-specific/linux/tt-kmd { }; 602 603 turbostat = callPackage ../os-specific/linux/turbostat { }; 604 605 corefreq = callPackage ../os-specific/linux/corefreq { }; 606 607 trelay = callPackage ../os-specific/linux/trelay { }; 608 609 universal-pidff = callPackage ../os-specific/linux/universal-pidff { }; 610 611 usbip = callPackage ../os-specific/linux/usbip { }; 612 613 v86d = callPackage ../os-specific/linux/v86d { }; 614 615 veikk-linux-driver = callPackage ../os-specific/linux/veikk-linux-driver { }; 616 vendor-reset = callPackage ../os-specific/linux/vendor-reset { }; 617 618 vhba = callPackage ../applications/emulators/cdemu/vhba.nix { }; 619 620 virtio_vmmci = callPackage ../os-specific/linux/virtio_vmmci { }; 621 622 virtualbox = callPackage ../os-specific/linux/virtualbox { 623 virtualbox = pkgs.virtualboxHardened; 624 }; 625 626 virtualboxGuestAdditions = 627 callPackage ../applications/virtualization/virtualbox/guest-additions 628 { }; 629 630 mm-tools = callPackage ../os-specific/linux/mm-tools { }; 631 632 vmm_clock = callPackage ../os-specific/linux/vmm_clock { }; 633 634 vmware = callPackage ../os-specific/linux/vmware { }; 635 636 wireguard = 637 if lib.versionOlder kernel.version "5.6" then 638 callPackage ../os-specific/linux/wireguard { } 639 else 640 null; 641 642 x86_energy_perf_policy = callPackage ../os-specific/linux/x86_energy_perf_policy { }; 643 644 xone = 645 if lib.versionAtLeast kernel.version "5.4" then callPackage ../os-specific/linux/xone { } else null; 646 647 xpadneo = callPackage ../os-specific/linux/xpadneo { }; 648 649 yt6801 = callPackage ../os-specific/linux/yt6801 { }; 650 651 ithc = callPackage ../os-specific/linux/ithc { }; 652 653 ryzen-smu = callPackage ../os-specific/linux/ryzen-smu { }; 654 655 zenpower = callPackage ../os-specific/linux/zenpower { }; 656 657 zfs_2_3 = callPackage ../os-specific/linux/zfs/2_3.nix { 658 configFile = "kernel"; 659 inherit pkgs kernel; 660 }; 661 zfs_2_4 = callPackage ../os-specific/linux/zfs/2_4.nix { 662 configFile = "kernel"; 663 inherit pkgs kernel; 664 }; 665 zfs_unstable = callPackage ../os-specific/linux/zfs/unstable.nix { 666 configFile = "kernel"; 667 inherit pkgs kernel; 668 }; 669 670 can-isotp = callPackage ../os-specific/linux/can-isotp { }; 671 672 qc71_laptop = callPackage ../os-specific/linux/qc71_laptop { }; 673 674 hid-ite8291r3 = callPackage ../os-specific/linux/hid-ite8291r3 { }; 675 676 hid-t150 = callPackage ../os-specific/linux/hid-t150 { }; 677 678 hid-tmff2 = callPackage ../os-specific/linux/hid-tmff2 { }; 679 680 hpuefi-mod = callPackage ../os-specific/linux/hpuefi-mod { }; 681 682 drbd = callPackage ../os-specific/linux/drbd/driver.nix { }; 683 684 nullfs = callPackage ../os-specific/linux/nullfs { }; 685 686 msi-ec = callPackage ../os-specific/linux/msi-ec { }; 687 688 tsme-test = callPackage ../os-specific/linux/tsme-test { }; 689 690 xpad-noone = callPackage ../os-specific/linux/xpad-noone { }; 691 692 } 693 // lib.optionalAttrs config.allowAliases { 694 zfs = throw "linuxPackages.zfs has been removed, use zfs_* instead, or linuxPackages.\${pkgs.zfs.kernelModuleAttribute}"; # added 2025-01-23 695 zfs_2_1 = throw "zfs_2_1 has been removed"; # added 2024-12-25; 696 ati_drivers_x11 = throw "ati drivers are no longer supported by any kernel >=4.1"; # added 2021-05-18; 697 deepin-anything-module = throw "the Deepin desktop environment and associated tools have been removed from nixpkgs due to lack of maintenance"; 698 exfat-nofuse = throw "exfat-nofuse has been removed, all kernels > 5.8 come with built-in exfat support"; # added 2025-10-07 699 hid-nintendo = throw "hid-nintendo was added in mainline kernel version 5.16"; # Added 2023-07-30 700 sch_cake = throw "sch_cake was added in mainline kernel version 4.19"; # Added 2023-06-14 701 rtl8723bs = throw "rtl8723bs was added in mainline kernel version 4.12"; # Added 2023-06-14 702 vm-tools = self.mm-tools; 703 xmm7360-pci = throw "Support for the XMM7360 WWAN card was added to the iosm kmod in mainline kernel version 5.18"; 704 amdgpu-pro = throw "amdgpu-pro was removed due to lack of maintenance"; # Added 2024-06-16 705 kvdo = throw "kvdo was removed, because it was added to mainline in kernel version 6.9"; # Added 2024-07-08 706 perf = lib.warnOnInstantiate "linuxPackages.perf is now perf" pkgs.perf; # Added 2025-08-28 707 system76-power = lib.warnOnInstantiate "kernelPackages.system76-power is now pkgs.system76-power" pkgs.system76-power; # Added 2024-10-16 708 system76-scheduler = lib.warnOnInstantiate "kernelPackages.system76-scheduler is now pkgs.system76-scheduler" pkgs.system76-scheduler; # Added 2024-10-16 709 tuxedo-keyboard = self.tuxedo-drivers; # Added 2024-09-28 710 phc-intel = throw "phc-intel drivers are no longer supported by any kernel >=4.17"; # added 2025-07-18 711 prl-tools = throw "Parallel Tools no longer provide any kernel module, please use pkgs.prl-tools instead."; # added 2025-10-04 712 nvidia_dc_565 = throw "nvidiaPackages.dc_565 has reached end of life, see https://endoflife.date/nvidia"; # added 2026-02-10 713 nvidia_dc_535 = throw "nvidiaPackages.dc_535 removed, soon reaches end of life, see https://endoflife.date/nvidia"; # added 2026-03-08 714 } 715 )).extend 716 (lib.fixedPoints.composeManyExtensions kernelPackagesExtensions); 717 718 hardenedPackagesFor = kernel: overrides: packagesFor (hardenedKernelFor kernel overrides); 719 720 vanillaPackages = { 721 # recurse to build modules for the kernels 722 linux_5_10 = recurseIntoAttrs (packagesFor kernels.linux_5_10); 723 linux_5_15 = recurseIntoAttrs (packagesFor kernels.linux_5_15); 724 linux_6_1 = recurseIntoAttrs (packagesFor kernels.linux_6_1); 725 linux_6_6 = recurseIntoAttrs (packagesFor kernels.linux_6_6); 726 linux_6_12 = recurseIntoAttrs (packagesFor kernels.linux_6_12); 727 linux_6_18 = recurseIntoAttrs (packagesFor kernels.linux_6_18); 728 linux_6_19 = recurseIntoAttrs (packagesFor kernels.linux_6_19); 729 } 730 // lib.optionalAttrs config.allowAliases { 731 linux_4_19 = throw "linux 4.19 was removed because it will reach its end of life within 24.11"; # Added 2024-09-21 732 linux_5_4 = throw "linux 5.4 was removed because it will reach its end of life within 25.11"; # Added 2025-10-22 733 linux_6_9 = throw "linux 6.9 was removed because it reached its end of life upstream"; # Added 2024-08-02 734 linux_6_10 = throw "linux 6.10 was removed because it reached its end of life upstream"; # Added 2024-10-23 735 linux_6_11 = throw "linux 6.11 was removed because it reached its end of life upstream"; # Added 2025-03-23 736 linux_6_13 = throw "linux 6.13 was removed because it reached its end of life upstream"; # Added 2025-06-22 737 linux_6_14 = throw "linux 6.14 was removed because it reached its end of life upstream"; # Added 2025-06-22 738 linux_6_15 = throw "linux 6.15 was removed because it reached its end of life upstream"; # Added 2025-08-23 739 linux_6_16 = throw "linux 6.16 was removed because it reached its end of life upstream"; # Added 2025-10-22 740 linux_6_17 = throw "linux 6.17 was removed because it reached its end of life upstream"; # Added 2025-12-22 741 }; 742 743 rtPackages = { 744 # realtime kernel packages 745 linux_rt_5_10 = packagesFor kernels.linux_rt_5_10; 746 linux_rt_5_15 = packagesFor kernels.linux_rt_5_15; 747 linux_rt_6_1 = packagesFor kernels.linux_rt_6_1; 748 linux_rt_6_6 = packagesFor kernels.linux_rt_6_6; 749 } 750 // lib.optionalAttrs config.allowAliases { 751 linux_rt_5_4 = throw "linux_rt 5.4 was removed because it will reach its end of life within 25.11"; # Added 2025-10-22 752 }; 753 754 rpiPackages = { 755 linux_rpi1 = packagesFor kernels.linux_rpi1; 756 linux_rpi2 = packagesFor kernels.linux_rpi2; 757 linux_rpi3 = packagesFor kernels.linux_rpi3; 758 linux_rpi4 = packagesFor kernels.linux_rpi4; 759 }; 760 761 packages = recurseIntoAttrs ( 762 vanillaPackages 763 // rtPackages 764 // rpiPackages 765 // { 766 767 # Intentionally lacks recurseIntoAttrs, as -rc kernels will quite likely break out-of-tree modules and cause failed Hydra builds. 768 linux_testing = packagesFor kernels.linux_testing; 769 770 linux_hardened = recurseIntoAttrs (packagesFor kernels.linux_hardened); 771 772 linux_6_12_hardened = recurseIntoAttrs (packagesFor kernels.linux_6_12_hardened); 773 774 linux_zen = recurseIntoAttrs (packagesFor kernels.linux_zen); 775 linux_xanmod = recurseIntoAttrs (packagesFor kernels.linux_xanmod); 776 linux_xanmod_stable = recurseIntoAttrs (packagesFor kernels.linux_xanmod_stable); 777 linux_xanmod_latest = recurseIntoAttrs (packagesFor kernels.linux_xanmod_latest); 778 } 779 // lib.optionalAttrs config.allowAliases { 780 linux_lqx = throw "linux_lqx has been removed due to lack of maintenance"; 781 linux_libre = throw "linux_libre has been removed due to lack of maintenance"; 782 linux_latest_libre = throw "linux_latest_libre has been removed due to lack of maintenance"; 783 784 linux_5_10_hardened = throw "linux_hardened on nixpkgs only contains latest stable and latest LTS"; 785 linux_5_15_hardened = throw "linux_hardened on nixpkgs only contains latest stable and latest LTS"; 786 linux_6_1_hardened = throw "linux_hardened on nixpkgs only contains latest stable and latest LTS"; 787 linux_6_6_hardened = throw "linux_hardened on nixpkgs only contains latest stable and latest LTS"; 788 789 linux_4_19_hardened = throw "linux 4.19 was removed because it will reach its end of life within 24.11"; 790 linux_5_4_hardened = throw "linux_5_4_hardened was removed because it was broken"; 791 linux_6_9_hardened = throw "linux 6.9 was removed because it has reached its end of life upstream"; 792 linux_6_10_hardened = throw "linux 6.10 was removed because it has reached its end of life upstream"; 793 linux_6_11_hardened = throw "linux 6.11 was removed because it has reached its end of life upstream"; 794 linux_6_13_hardened = throw "linux 6.13 was removed because it has reached its end of life upstream"; 795 linux_6_14_hardened = throw "linux 6.14 was removed because it has reached its end of life upstream"; 796 linux_6_15_hardened = throw "linux 6.15 was removed because it has reached its end of life upstream"; 797 linux_ham = throw "linux_ham has been removed in favour of the standard kernel packages"; 798 } 799 ); 800 801 packageAliases = { 802 linux_default = packages.linux_6_18; 803 # Update this when adding the newest kernel major version! 804 linux_latest = packages.linux_6_19; 805 linux_rt_default = packages.linux_rt_5_15; 806 linux_rt_latest = packages.linux_rt_6_6; 807 } 808 // lib.optionalAttrs config.allowAliases { 809 linux_mptcp = throw "'linux_mptcp' has been moved to https://github.com/teto/mptcp-flake"; 810 }; 811 812 manualConfig = callPackage ../os-specific/linux/kernel/build.nix { }; 813 814 customPackage = 815 { 816 version, 817 src, 818 modDirVersion ? lib.versions.pad 3 version, 819 configfile, 820 allowImportFromDerivation ? false, 821 }: 822 recurseIntoAttrs ( 823 packagesFor (manualConfig { 824 inherit 825 version 826 src 827 modDirVersion 828 configfile 829 allowImportFromDerivation 830 ; 831 }) 832 ); 833 834 # Derive one of the default .config files 835 linuxConfig = 836 { 837 src, 838 kernelPatches ? [ ], 839 version ? (builtins.parseDrvName src.name).version, 840 makeTarget ? "defconfig", 841 name ? "kernel.config", 842 }: 843 stdenvNoCC.mkDerivation { 844 inherit name src; 845 depsBuildBuild = [ 846 buildPackages.stdenv.cc 847 ] 848 ++ lib.optionals (lib.versionAtLeast version "4.16") [ 849 buildPackages.bison 850 buildPackages.flex 851 ]; 852 patches = map (p: p.patch) kernelPatches; # Patches may include new configs. 853 postPatch = '' 854 patchShebangs scripts/ 855 ''; 856 buildPhase = '' 857 set -x 858 make \ 859 ARCH=${stdenv.hostPlatform.linuxArch} \ 860 HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc \ 861 ${makeTarget} 862 ''; 863 installPhase = '' 864 cp .config $out 865 ''; 866 }; 867 868 buildLinux = callPackage ../os-specific/linux/kernel/generic.nix { }; 869}