Merge pull request #67 from nix-community/call-package

make deprecated callPackage api a evaluation failure
This commit is contained in:
Jörg Thalheim 2018-08-14 20:48:47 +02:00 committed by GitHub
commit 355dfd0b83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,8 +27,7 @@ let
# True if not all arguments are either passed by default (e.g. pkgs) or defaulted (e.g. foo ? 10)
usesCallPackage = ! lib.all (arg: lib.elem arg (lib.attrNames passedArgs) || args.${arg}) (lib.attrNames args);
in if usesCallPackage then lib.warn ''
in if usesCallPackage then throw ''
NUR repository ${prettyName} is using the deprecated callPackage syntax which
might result in infinite recursion when used with NixOS modules.
'' (passedArgs.pkgs.callPackages src {})
else expr (builtins.intersectAttrs args passedArgs)
'' else expr (builtins.intersectAttrs args passedArgs)