From 3e3bfc66f7b98d7b57f67ba201dd446be9512078 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 5 Aug 2017 16:44:12 +0200 Subject: [PATCH] lib/types: nixos manual documentation for signed/unsinged int Synchronize the manual for the new types. --- nixos/doc/manual/development/option-types.xml | 85 +++++++++++++++---- 1 file changed, 70 insertions(+), 15 deletions(-) diff --git a/nixos/doc/manual/development/option-types.xml b/nixos/doc/manual/development/option-types.xml index dedfc286ca3..ccdbc0900be 100644 --- a/nixos/doc/manual/development/option-types.xml +++ b/nixos/doc/manual/development/option-types.xml @@ -22,21 +22,6 @@ A boolean, its values can be true or false. - - types.int - An integer. - - - - types.intBetween - min - max - - An integer between min - and max (both inclusive). - Useful for e.g. port ranges. - - types.path A filesystem path, defined as anything that when coerced to @@ -50,6 +35,65 @@ +Integer related types: + + + + + types.ints.signed + + A signed integer. + + + + + types.ints{signed8, signed16, signed32} + + + Signed integers with a fixed length (8, 16 or 32 bits). + They go from + −2n/2 + to + 2n/2−1 + + respectively (e.g. −128 to 127 + for 8 bits). + + + + types.int + A convenience alias for ints.signed. + + + + + types.ints.unsigned + + An unsigned integer (that is ≥ 0). + + + + + types.ints{unsigned8, unsigned16, unsigned32} + + + Unsigned integers with a fixed length (8, 16 or 32 bits). + They go from + 0 to + 2n−1 + + respectively (e.g. 0 to 255 + for 8 bits). + + + + + types.port + + A network port number (0–65635). + + + String related types: @@ -95,6 +139,17 @@ sep, e.g. types.separatedString "|". + + + types.ints.between + lowest + highest + + An integer between lowest + and highest (both inclusive). + Useful for e.g. creating types like types.port. + + types.submodule o A set of sub options o.