diff options
author | Shea Levy <shea@shealevy.com> | 2018-01-31 14:02:19 -0500 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2018-01-31 14:02:19 -0500 |
commit | 943592f69850fd07dd2422da062b1c1ebc45974d (patch) | |
tree | 3376a06cd3ab25a1622c8f320573ab09b55a9470 /pkgs | |
parent | 0d7a0d7572d35526ddf34b6d011b7b88a8904b36 (diff) |
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.
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/emacs/wrapper.nix | 2 | ||||
-rw-r--r-- | pkgs/development/beam-modules/lib.nix | 4 | ||||
-rw-r--r-- | pkgs/development/haskell-modules/make-package-set.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/darwin/apple-source-releases/default.nix | 2 | ||||
-rw-r--r-- | pkgs/top-level/default.nix | 2 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/pkgs/build-support/emacs/wrapper.nix b/pkgs/build-support/emacs/wrapper.nix index 27633c912b234..4e780b104b087 100644 --- a/pkgs/build-support/emacs/wrapper.nix +++ b/pkgs/build-support/emacs/wrapper.nix @@ -40,7 +40,7 @@ packagesFun: # packages explicitly requested by the user let explicitRequires = - if builtins.isFunction packagesFun + if lib.isFunction packagesFun then packagesFun self else packagesFun; in diff --git a/pkgs/development/beam-modules/lib.nix b/pkgs/development/beam-modules/lib.nix index 26d868a8e7c4f..d6b83cb1af04e 100644 --- a/pkgs/development/beam-modules/lib.nix +++ b/pkgs/development/beam-modules/lib.nix @@ -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; diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix index 223f06528879b..0f866a96e71e6 100644 --- a/pkgs/development/haskell-modules/make-package-set.nix +++ b/pkgs/development/haskell-modules/make-package-set.nix @@ -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 // { diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 478f9e7e303f6..cca729016c25b 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -186,7 +186,7 @@ let # There should be an IOVideo here, but they haven't released it :( }; - IOKitSrcs = stdenv.lib.mapAttrs (name: value: if builtins.isFunction value then value name else value) IOKitSpecs; + IOKitSrcs = stdenv.lib.mapAttrs (name: value: if stdenv.lib.isFunction value then value name else value) IOKitSpecs; adv_cmds = applePackage "adv_cmds" "osx-10.5.8" "102ssayxbg9wb35mdmhswbnw0bg7js3pfd8fcbic83c5q3bqa6c6" {}; diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix index 96d5e1fe28395..9cf9eb4db658a 100644 --- a/pkgs/top-level/default.nix +++ b/pkgs/top-level/default.nix @@ -49,7 +49,7 @@ in let # { /* the config */ } and # { pkgs, ... } : { /* the config */ } config = - if builtins.isFunction configExpr + if lib.isFunction configExpr then configExpr { inherit pkgs; } else configExpr; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1820125b0a585..bc3ea1027e7d8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -40,7 +40,7 @@ let makeOverridablePythonPackage = f: origArgs: let ff = f origArgs; - overrideWith = newArgs: origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs); + overrideWith = newArgs: origArgs // (if pkgs.lib.isFunction newArgs then newArgs origArgs else newArgs); in if builtins.isAttrs ff then (ff // { overridePythonAttrs = newArgs: makeOverridablePythonPackage f (overrideWith newArgs); |