about summary refs log tree commit diff
path: root/yants.nix
diff options
context:
space:
mode:
Diffstat (limited to 'yants.nix')
-rw-r--r--yants.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/yants.nix b/yants.nix
index 03e5114033a6..c5fff0ea7d0f 100644
--- a/yants.nix
+++ b/yants.nix
@@ -28,6 +28,8 @@ with builtins; let
     "${n}" = t1: t2: typedef "${n}<${t1.name},${t2.name}>" (c t1 t2);
   };
 
+  ofType = t: x: isAttrs x && x ? "type" && x.type == t;
+
   typeSet = foldl' (s: t: s // (if t ? "name" then { "${t.name}" = t; } else t)) {};
 
   # Struct checker implementation
@@ -76,6 +78,7 @@ in (typeSet [
   (typedef "bool" isBool)
   (typedef "float" isFloat)
   (typedef "string" isString)
+  (typedef "derivation" (ofType "derivation"))
 
   # Polymorphic types
   (poly "option" (t: v: (isNull v) || t.check v))