summaryrefslogtreecommitdiffstats
path: root/lib/default.nix
diff options
context:
space:
mode:
authorlassulus <lass@lassul.us>2017-06-20 16:05:27 +0200
committerlassulus <lass@lassul.us>2017-06-20 16:05:27 +0200
commitf0bcc6e1f147726cbbf8c3d8a9da503886d2321d (patch)
treebf8e0eabe03a8dcf9201c580ab1f4ecc4660b8b4 /lib/default.nix
parentbda14221cf46003ecf76756a5db7422c70737c85 (diff)
parent57c6b890f9088bb333eeab215ecfeca9d09ce3ef (diff)
Merge remote-tracking branch 'ni/master' into HEAD
Diffstat (limited to 'lib/default.nix')
-rw-r--r--lib/default.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 9399a0107..803a614a1 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -29,6 +29,10 @@ let
setAttr = name: value: set: set // { ${name} = value; };
+ test = re: x: isString x && testString re x;
+
+ testString = re: x: match re x != null;
+
toC = x: let
type = typeOf x;
reject = throw "cannot convert ${type}";