summaryrefslogtreecommitdiffstats
path: root/lib/generators.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/generators.nix
parent0d7a0d7572d35526ddf34b6d011b7b88a8904b36 (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 'lib/generators.nix')
-rw-r--r--lib/generators.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/generators.nix b/lib/generators.nix
index f207033c9554..73017f2c6796 100644
--- a/lib/generators.nix
+++ b/lib/generators.nix
@@ -14,6 +14,8 @@ let
libAttr = lib.attrsets;
flipMapAttrs = flip libAttr.mapAttrs;
+
+ inherit (lib) isFunction;
in
rec {
@@ -110,7 +112,7 @@ rec {
else if isString v then "\"" + v + "\""
else if null == v then "null"
else if isFunction v then
- let fna = functionArgs v;
+ let fna = lib.functionArgs v;
showFnas = concatStringsSep "," (libAttr.mapAttrsToList
(name: hasDefVal: if hasDefVal then "(${name})" else name)
fna);