lib/types: nixos manual documentation for signed/unsinged int

Synchronize the manual for the new types.
This commit is contained in:
Profpatsch 2017-08-05 16:44:12 +02:00
parent c776489cac
commit 3e3bfc66f7

View file

@ -22,21 +22,6 @@
<listitem><para>A boolean, its values can be <literal>true</literal> or
<literal>false</literal>.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>types.int</varname></term>
<listitem><para>An integer.</para></listitem>
</varlistentry>
<varlistentry>
<term>
<varname>types.intBetween</varname>
<replaceable>min</replaceable>
<replaceable>max</replaceable>
</term>
<listitem><para>An integer between <replaceable>min</replaceable>
and <replaceable>max</replaceable> (both inclusive).
Useful for e.g. port ranges.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>types.path</varname></term>
<listitem><para>A filesystem path, defined as anything that when coerced to
@ -50,6 +35,65 @@
</varlistentry>
</variablelist>
<para>Integer related types:</para>
<variablelist>
<varlistentry>
<term>
<varname>types.ints.signed</varname>
</term>
<listitem><para>A signed integer.
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<varname>types.ints{signed8, signed16, signed32}</varname>
</term>
<listitem>
<para>Signed integers with a fixed length (8, 16 or 32 bits).
They go from
<inlineequation><mathphrase>2<superscript>n</superscript>/2</mathphrase>
</inlineequation> to <inlineequation>
<mathphrase>2<superscript>n</superscript>/21</mathphrase>
</inlineequation>
respectively (e.g. <literal>128</literal> to <literal>127</literal>
for 8 bits).
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>types.int</varname></term>
<listitem><para>A convenience alias for <literal>ints.signed</literal>.
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<varname>types.ints.unsigned</varname>
</term>
<listitem><para>An unsigned integer (that is ≥ 0).
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<varname>types.ints{unsigned8, unsigned16, unsigned32}</varname>
</term>
<listitem>
<para>Unsigned integers with a fixed length (8, 16 or 32 bits).
They go from
<inlineequation><mathphrase>0</mathphrase></inlineequation> to <inlineequation>
<mathphrase>2<superscript>n</superscript>1</mathphrase>
</inlineequation>
respectively (e.g. <literal>0</literal> to <literal>255</literal>
for 8 bits).
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<varname>types.port</varname>
</term>
<listitem><para>A network port number (065635).</para></listitem>
</varlistentry>
</variablelist>
<para>String related types:</para>
<variablelist>
@ -95,6 +139,17 @@
<replaceable>sep</replaceable>, e.g. <literal>types.separatedString
"|"</literal>.</para></listitem>
</varlistentry>
<varlistentry>
<term>
<varname>types.ints.between</varname>
<replaceable>lowest</replaceable>
<replaceable>highest</replaceable>
</term>
<listitem><para>An integer between <replaceable>lowest</replaceable>
and <replaceable>highest</replaceable> (both inclusive).
Useful for e.g. creating types like <literal>types.port</literal>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>types.submodule</varname> <replaceable>o</replaceable></term>
<listitem><para>A set of sub options <replaceable>o</replaceable>.