summary refs log tree commit diff
path: root/pkgs/lib/types.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/lib/types.nix')
-rw-r--r--pkgs/lib/types.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/lib/types.nix b/pkgs/lib/types.nix
index d71cb9df097..fd3c071c0be 100644
--- a/pkgs/lib/types.nix
+++ b/pkgs/lib/types.nix
@@ -12,6 +12,10 @@ rec {
   hasType = x: isAttrs x && x ? _type;
   typeOf = x: if hasType x then x._type else "";
 
+  setType = typeName: value: value // {
+    _type = typeName;
+  };
+
   
   # name (name of the type)
   # check (boolean function)