diff options
author | lassulus <lass@aidsballs.de> | 2016-03-16 09:16:41 +0100 |
---|---|---|
committer | lassulus <lass@aidsballs.de> | 2016-03-16 09:16:41 +0100 |
commit | 9e9bc01fc974781091dcb06085952acd0b9a191c (patch) | |
tree | 3b16aa7fe69bf79d967ca11a4fc3efa336000cf7 /krebs/4lib/default.nix | |
parent | 6eedc423e3df2c1357fa23cb3fb5e67dc895a4fa (diff) | |
parent | 04ba4784ae0918fe9e79af5c95bace3cf8605792 (diff) |
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'krebs/4lib/default.nix')
-rw-r--r-- | krebs/4lib/default.nix | 5 |
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 |