summary refs log tree commit diff
path: root/lib/types.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/types.nix')
-rw-r--r--lib/types.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix
index cf8eef00833..2b3aa23df2f 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -201,6 +201,9 @@ rec {
       name = /* builtins.trace "types.optionSet is deprecated; use types.submodule instead" */ "option set";
     };
 
+    # Augment the given type with an additional type check function.
+    addCheck = elemType: check: elemType // { check = x: elemType.check x && check x; };
+
   };
 
 }