summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/lib/types.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/lib/types.nix b/pkgs/lib/types.nix
index 6bc2e0f1ecb3..1cb1185b8bb8 100644
--- a/pkgs/lib/types.nix
+++ b/pkgs/lib/types.nix
@@ -11,7 +11,7 @@ with import ./trivial.nix;
 rec {
 
   hasType = x: isAttrs x && x ? _type;
-  typeOf = x: if hasType x then x._type else "";
+  typeOf = x: x._type or "";
 
   setType = typeName: value: value // {
     _type = typeName;