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.
wip/yesman
Matthew Bauer 6 years ago
parent 2911ece392
commit 9d7c57afc4
  1. 11
      pkgs/top-level/aliases.nix

@ -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

Loading…
Cancel
Save