aliases: add check if alias still exists in all-packages.nix

If an alias is already defined in all-packages.nix, we want to throw
an error to make it obvious that something is wrong. Otherwise there
is no way to realize that the alias is shadowing the real definition.
This commit is contained in:
Matthew Bauer 2018-04-29 17:44:18 -05:00
parent 2911ece392
commit 9d7c57afc4

View File

@ -17,8 +17,17 @@ let
dontDistribute alias
else alias;
# Make sure that we are not shadowing something from
# all-packages.nix.
checkInPkgs = n: alias: if builtins.hasAttr n self
then throw "Alias ${n} is still in all-packages.nix"
else alias;
mapAliases = aliases:
lib.mapAttrs (n: alias: removeDistribute (removeRecurseForDerivations alias)) aliases;
lib.mapAttrs (n: alias: removeDistribute
(removeRecurseForDerivations
(checkInPkgs n alias)))
aliases;
in
### Deprecated aliases - for backward compatibility