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:
+3
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user