diff options
-rw-r--r-- | default.nix | 1 | ||||
-rw-r--r-- | tests.nix | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/default.nix b/default.nix index 17564b61b91e..9cd09e644028 100644 --- a/default.nix +++ b/default.nix @@ -97,6 +97,7 @@ in lib.fix (self: { bool = typedef "bool" isBool; float = typedef "float" isFloat; string = typedef "string" isString; + path = typedef "path" (x: typeOf x == "path"); drv = typedef "derivation" (x: isAttrs x && x ? "type" && x.type == "derivation"); function = typedef "function" (x: isFunction x || (isAttrs x && x ? "__functor" && isFunction x.__functor)); diff --git a/tests.nix b/tests.nix index 344f2c1f5934..f2380a770945 100644 --- a/tests.nix +++ b/tests.nix @@ -12,6 +12,7 @@ deepSeq rec { (float 13.37) (string "Hello!") (function (x: x * 2)) + (path /nix) ]; # Test that polymorphic types work as intended @@ -76,7 +77,7 @@ deepSeq rec { # Test that all types are types. testTypes = map type [ - any bool drv float int string + any bool drv float int string path (attrs int) (either int string) |