summaryrefslogtreecommitdiffstats
path: root/krebs/4lib/default.nix
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2016-03-16 09:16:41 +0100
committerlassulus <lass@aidsballs.de>2016-03-16 09:16:41 +0100
commit9e9bc01fc974781091dcb06085952acd0b9a191c (patch)
tree3b16aa7fe69bf79d967ca11a4fc3efa336000cf7 /krebs/4lib/default.nix
parent6eedc423e3df2c1357fa23cb3fb5e67dc895a4fa (diff)
parent04ba4784ae0918fe9e79af5c95bace3cf8605792 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'krebs/4lib/default.nix')
-rw-r--r--krebs/4lib/default.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix
index deac02bb7..585bd313f 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");
@@ -41,7 +41,10 @@ let out = rec {
mapAttrs (name: _: path + "/${name}")
(filterAttrs (_: eq "directory") (readDir path));
+ getAttrDef = name: set: set.${name} or set.default or null;
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