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:
@@ -81,8 +81,8 @@ let
|
||||
# lost on `.override`) but determine the auto-args based on `drv` (the problem here
|
||||
# is that nix has no way to "passthrough" args while preserving the reflection
|
||||
# info that callPackage uses to determine the arguments).
|
||||
drv = if builtins.isFunction fn then fn else import fn;
|
||||
auto = builtins.intersectAttrs (builtins.functionArgs drv) scope;
|
||||
drv = if stdenv.lib.isFunction fn then fn else import fn;
|
||||
auto = builtins.intersectAttrs (stdenv.lib.functionArgs drv) scope;
|
||||
|
||||
# this wraps the `drv` function to add a `overrideScope` function to the result.
|
||||
drvScope = allArgs: drv allArgs // {
|
||||
|
||||
Reference in New Issue
Block a user