summaryrefslogtreecommitdiffstats
path: root/krebs/4lib/default.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-03-16 01:17:07 +0100
committertv <tv@krebsco.de>2016-03-16 01:17:07 +0100
commit1ff38bf6c69fd68cbf4e158a96cd8c97d6cf305d (patch)
tree20373a8819cc51aea0c6d35e4813c4d4828d7f03 /krebs/4lib/default.nix
parent91844576fd201c628e070761be1eaffe3e40eca8 (diff)
krebs lib += optionalTrace
Diffstat (limited to 'krebs/4lib/default.nix')
-rw-r--r--krebs/4lib/default.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix
index deac02bb7..e984614a0 100644
--- a/krebs/4lib/default.nix
+++ b/krebs/4lib/default.nix
@@ -17,7 +17,7 @@ let out = rec {
types = import ./types.nix {
inherit config;
- lib = lib // { inherit genid; };
+ lib = lib // { inherit genid optionalTrace; };
};
dir.has-default-nix = path: pathExists (path + "/default.nix");
@@ -44,4 +44,6 @@ let out = rec {
mapAttrValues = f: mapAttrs (_: f);
setAttr = name: value: set: set // { ${name} = value; };
+ optionalTrace = c: msg: x: if c then trace msg x else x;
+
}; in out