summary refs log tree commit diff
path: root/pkgs/lib/types.nix
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2012-12-31 13:59:30 -0500
committerShea Levy <shea@shealevy.com>2012-12-31 13:59:30 -0500
commitc1598d167e5e3714b70cddef4fa3458e2a03635e (patch)
treeffdc3f5d577ebd1bf9f2ee97b7e057a1bed57906 /pkgs/lib/types.nix
parentb5a3ae7b22ea65949c2b65a17c9459a978a49206 (diff)
downloadnixpkgs-c1598d167e5e3714b70cddef4fa3458e2a03635e.tar
nixpkgs-c1598d167e5e3714b70cddef4fa3458e2a03635e.tar.gz
nixpkgs-c1598d167e5e3714b70cddef4fa3458e2a03635e.tar.bz2
nixpkgs-c1598d167e5e3714b70cddef4fa3458e2a03635e.tar.lz
nixpkgs-c1598d167e5e3714b70cddef4fa3458e2a03635e.tar.xz
nixpkgs-c1598d167e5e3714b70cddef4fa3458e2a03635e.tar.zst
nixpkgs-c1598d167e5e3714b70cddef4fa3458e2a03635e.zip
Simplify lib.typeOf
Diffstat (limited to 'pkgs/lib/types.nix')
-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 6bc2e0f1ecb..1cb1185b8bb 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;