Commit 807ac7dc authored by Alyssa Ross's avatar Alyssa Ross
Browse files

linuxKernel: respect config.allowAliases

In Nixpkgs, we generally gate throws for package removals behind
config.allowAliases (as seen elsewhere in this very file already!),
which has nice properties like making it possible to test evaluation
of all the packages in an attrset that are expected to evaluate by
disabling aliases.
parent bfef542b
Loading
Loading
Loading
Loading
+19 −18
Original line number Diff line number Diff line
@@ -96,8 +96,6 @@ in {
      rpiVersion = 4;
    };

    linux_4_9 = throw "linux 4.9 was removed because it will reach its end of life within 22.11";

    linux_4_14 = callPackage ../os-specific/linux/kernel/linux-4.14.nix {
      kernelPatches =
        [ kernelPatches.bridge_stp_helper
@@ -163,12 +161,6 @@ in {
      ];
    };

    linux_5_18 = throw "linux 5.18 was removed because it has reached its end of life upstream";

    linux_5_19 = throw "linux 5.19 was removed because it has reached its end of life upstream";

    linux_6_0 = throw "linux 6.0 was removed because it has reached its end of life upstream";

    linux_6_1 = callPackage ../os-specific/linux/kernel/linux-6.1.nix {
      kernelPatches = [
        kernelPatches.bridge_stp_helper
@@ -248,7 +240,6 @@ in {
    linux_xanmod = xanmodKernels.lts;
    linux_xanmod_stable = xanmodKernels.main;
    linux_xanmod_latest = xanmodKernels.main;
    linux_xanmod_tt = throw "linux_xanmod_tt was removed because upstream no longer offers this option";

    linux_libre = deblobKernel packageAliases.linux_default.kernel;

@@ -261,11 +252,19 @@ in {
    linux_5_4_hardened = hardenedKernelFor kernels.linux_5_4 { };
    linux_5_10_hardened = hardenedKernelFor kernels.linux_5_10 { };
    linux_5_15_hardened = hardenedKernelFor kernels.linux_5_15 { };
    linux_6_1_hardened = hardenedKernelFor kernels.linux_6_1 { };

  } // lib.optionalAttrs config.allowAliases {
    linux_4_9 = throw "linux 4.9 was removed because it will reach its end of life within 22.11";
    linux_5_18 = throw "linux 5.18 was removed because it has reached its end of life upstream";
    linux_5_19 = throw "linux 5.19 was removed because it has reached its end of life upstream";
    linux_6_0 = throw "linux 6.0 was removed because it has reached its end of life upstream";

    linux_xanmod_tt = throw "linux_xanmod_tt was removed because upstream no longer offers this option";

    linux_5_18_hardened = throw "linux 5.18 was removed because it has reached its end of life upstream";
    linux_5_19_hardened = throw "linux 5.19 was removed because it has reached its end of life upstream";
    linux_6_0_hardened = throw "linux 6.0 was removed because it has reached its end of life upstream";
    linux_6_1_hardened = hardenedKernelFor kernels.linux_6_1 { };

  }));
  /*  Linux kernel modules are inherently tied to a specific kernel.  So
    rather than provide specific instances of those packages for a
@@ -541,17 +540,18 @@ in {

  vanillaPackages = {
    # recurse to build modules for the kernels
    linux_4_9 = throw "linux 4.9 was removed because it will reach its end of life within 22.11"; # Added 2022-11-08
    linux_4_14 = recurseIntoAttrs (packagesFor kernels.linux_4_14);
    linux_4_19 = recurseIntoAttrs (packagesFor kernels.linux_4_19);
    linux_5_4 = recurseIntoAttrs (packagesFor kernels.linux_5_4);
    linux_5_10 = recurseIntoAttrs (packagesFor kernels.linux_5_10);
    linux_5_15 = recurseIntoAttrs (packagesFor kernels.linux_5_15);
    linux_6_1 = recurseIntoAttrs (packagesFor kernels.linux_6_1);
    linux_6_2 = recurseIntoAttrs (packagesFor kernels.linux_6_2);
  } // lib.optionalAttrs config.allowAliases {
    linux_4_9 = throw "linux 4.9 was removed because it will reach its end of life within 22.11"; # Added 2022-11-08
    linux_5_18 = throw "linux 5.18 was removed because it reached its end of life upstream"; # Added 2022-09-17
    linux_5_19 = throw "linux 5.19 was removed because it reached its end of life upstream"; # Added 2022-11-01
    linux_6_0 = throw "linux 6.0 was removed because it reached its end of life upstream"; # Added 2023-01-20
    linux_6_1 = recurseIntoAttrs (packagesFor kernels.linux_6_1);
    linux_6_2 = recurseIntoAttrs (packagesFor kernels.linux_6_2);
  };

  rtPackages = {
@@ -590,9 +590,6 @@ in {
    });
    linux_5_10_hardened = recurseIntoAttrs (hardenedPackagesFor kernels.linux_5_10 { });
    linux_5_15_hardened = recurseIntoAttrs (hardenedPackagesFor kernels.linux_5_15 { });
    linux_5_18_hardened = throw "linux 5.18 was removed because it has reached its end of life upstream";
    linux_5_19_hardened = throw "linux 5.19 was removed because it has reached its end of life upstream";
    linux_6_0_hardened = throw "linux 6.0 was removed because it has reached its end of life upstream";
    linux_6_1_hardened = recurseIntoAttrs (hardenedPackagesFor kernels.linux_6_1 { });

    linux_zen = recurseIntoAttrs (packagesFor kernels.linux_zen);
@@ -600,13 +597,17 @@ in {
    linux_xanmod = recurseIntoAttrs (packagesFor kernels.linux_xanmod);
    linux_xanmod_stable = recurseIntoAttrs (packagesFor kernels.linux_xanmod_stable);
    linux_xanmod_latest = recurseIntoAttrs (packagesFor kernels.linux_xanmod_latest);
    linux_xanmod_tt = throw "linux_xanmod_tt was removed because upstream no longer offers this option";

    hardkernel_4_14 = recurseIntoAttrs (packagesFor kernels.linux_hardkernel_4_14);

    linux_libre = recurseIntoAttrs (packagesFor kernels.linux_libre);

    linux_latest_libre = recurseIntoAttrs (packagesFor kernels.linux_latest_libre);
  } // lib.optionalAttrs config.allowAliases {
    linux_5_18_hardened = throw "linux 5.18 was removed because it has reached its end of life upstream";
    linux_5_19_hardened = throw "linux 5.19 was removed because it has reached its end of life upstream";
    linux_6_0_hardened = throw "linux 6.0 was removed because it has reached its end of life upstream";
    linux_xanmod_tt = throw "linux_xanmod_tt was removed because upstream no longer offers this option";
  });

  packageAliases = {