summary refs log tree commit diff
path: root/lib/deprecated.nix
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2018-01-31 14:02:19 -0500
committerShea Levy <shea@shealevy.com>2018-01-31 14:02:19 -0500
commit943592f69850fd07dd2422da062b1c1ebc45974d (patch)
tree3376a06cd3ab25a1622c8f320573ab09b55a9470 /lib/deprecated.nix
parent0d7a0d7572d35526ddf34b6d011b7b88a8904b36 (diff)
downloadnixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar
nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar.gz
nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar.bz2
nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar.lz
nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar.xz
nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar.zst
nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.zip
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 'lib/deprecated.nix')
-rw-r--r--lib/deprecated.nix8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/deprecated.nix b/lib/deprecated.nix
index 2a0f5a55bf1..34cf336d1f4 100644
--- a/lib/deprecated.nix
+++ b/lib/deprecated.nix
@@ -1,6 +1,6 @@
 { lib }:
 let
-    inherit (builtins) isFunction head tail isList isAttrs isInt attrNames;
+    inherit (builtins) head tail isList isAttrs isInt attrNames;
 
 in
 
@@ -53,7 +53,7 @@ rec {
           f:        # the function applied to the arguments
           initial:  # you pass attrs, the functions below are passing a function taking the fix argument
     let
-        takeFixed = if isFunction initial then initial else (fixed : initial); # transform initial to an expression always taking the fixed argument
+        takeFixed = if lib.isFunction initial then initial else (fixed : initial); # transform initial to an expression always taking the fixed argument
         tidy = args:
             let # apply all functions given in "applyPreTidy" in sequence
                 applyPreTidyFun = fold ( n: a: x: n ( a x ) ) lib.id (maybeAttr "applyPreTidy" [] args);
@@ -63,7 +63,7 @@ rec {
                     let args = takeFixed fixed;
                         mergeFun = args.${n};
                     in if isAttrs x then (mergeFun args x)
-                       else assert isFunction x;
+                       else assert lib.isFunction x;
                             mergeFun args (x ( args // { inherit fixed; }));
             in overridableDelayableArgs f newArgs;
     in
@@ -374,7 +374,7 @@ rec {
       if isAttrs x then
           if x ? outPath then "derivation"
           else "attrs"
-      else if isFunction x then "function"
+      else if lib.isFunction x then "function"
       else if isList x then "list"
       else if x == true then "bool"
       else if x == false then "bool"