mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
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:
parent
2911ece392
commit
9d7c57afc4
@ -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…
Reference in New Issue
Block a user