diff options
author | makefu <github@syntax-fehler.de> | 2016-03-16 08:26:27 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2016-03-16 08:26:27 +0100 |
commit | 90150375a87298f69778aff5b2eb4f05a0f7e63d (patch) | |
tree | 4f9246bb93ea4376ebe1906db9360fb9bced2da0 /krebs/4lib/default.nix | |
parent | 57476fb24a71dd709105ab61f380e12bca592279 (diff) | |
parent | 20afe7b9aeb5d523e10a0d5c597b8c1656bca58e (diff) |
Merge remote-tracking branch 'cd/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 |