From e6657cd46a6b97153f80006144fe6293f715bb7d Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 16 Mar 2016 01:52:34 +0100 Subject: krebs lib += getAttrDef --- krebs/4lib/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'krebs/4lib') diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index e984614a0..585bd313f 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -41,6 +41,7 @@ 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; }; -- cgit v1.2.3