Add setFunctionArgs lib function.
Among other things, this will allow *2nix tools to output plain data while still being composable with the traditional callPackage/.override interfaces.
This commit is contained in:
@@ -6,8 +6,8 @@ rec {
|
||||
*/
|
||||
callPackageWith = autoArgs: fn: args:
|
||||
let
|
||||
f = if builtins.isFunction fn then fn else import fn;
|
||||
auto = builtins.intersectAttrs (builtins.functionArgs f) autoArgs;
|
||||
f = if pkgs.lib.isFunction fn then fn else import fn;
|
||||
auto = builtins.intersectAttrs (stdenv.lib.functionArgs f) autoArgs;
|
||||
in f (auto // args);
|
||||
|
||||
callPackage = callPackageWith pkgs;
|
||||
|
||||
Reference in New Issue
Block a user