diff options
Diffstat (limited to 'pkgs/lib/types.nix')
-rw-r--r-- | pkgs/lib/types.nix | 4 |
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) |