about 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.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix
index 021641fdc229c..1675a54156df4 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -151,6 +151,10 @@ rec {
           name = "unsignedInt";
           description = "unsigned integer, meaning >=0";
         };
+        positive = addCheck types.int (x: x > 0) // {
+          name = "positiveInt";
+          description = "positive integer, meaning >0";
+        };
         u8 = unsign 8 256;
         u16 = unsign 16 65536;
         u32 = unsign 32 4294967296;