nixVersions: hide removed versions for allowAliases = false

By convention, we don't include attributes for throws for removed
versions in Nixpkgs when config.allowAliases is disabled.  (This can
be confirmed by grepping for "allowAliases".)  This makes it possible
to e.g. iterate over nixVersions.
This commit is contained in:
Alyssa Ross 2023-06-28 14:43:10 +00:00
parent cb3dc949be
commit 63bd7437bd

View File

@ -1,4 +1,5 @@
{ lib
, config
, aws-sdk-cpp
, boehmgc
, callPackage
@ -118,7 +119,7 @@ let
hash = "sha256-YrmFkVpwPreiig1/BsP+DInpTdQrPmS7bEY0WUGpw+c=";
};
in lib.makeExtensible (self: {
in lib.makeExtensible (self: ({
nix_2_3 = (common rec {
version = "2.3.16";
src = fetchurl {
@ -130,18 +131,6 @@ in lib.makeExtensible (self: {
];
}).override { boehmgc = boehmgc-nix_2_3; };
nix_2_4 = throw "nixVersions.nix_2_4 has been removed";
nix_2_5 = throw "nixVersions.nix_2_5 has been removed";
nix_2_6 = throw "nixVersions.nix_2_6 has been removed";
nix_2_7 = throw "nixVersions.nix_2_7 has been removed";
nix_2_8 = throw "nixVersions.nix_2_8 has been removed";
nix_2_9 = throw "nixVersions.nix_2_9 has been removed";
nix_2_10 = common {
version = "2.10.3";
hash = "sha256-B9EyDUz/9tlcWwf24lwxCFmkxuPTVW7HFYvp0C4xGbc=";
@ -217,4 +206,16 @@ in lib.makeExtensible (self: {
stable = self.nix_2_15;
unstable = self.nix_2_16;
})
} // lib.optionalAttrs config.allowAliases {
nix_2_4 = throw "nixVersions.nix_2_4 has been removed";
nix_2_5 = throw "nixVersions.nix_2_5 has been removed";
nix_2_6 = throw "nixVersions.nix_2_6 has been removed";
nix_2_7 = throw "nixVersions.nix_2_7 has been removed";
nix_2_8 = throw "nixVersions.nix_2_8 has been removed";
nix_2_9 = throw "nixVersions.nix_2_9 has been removed";
}))