lib/types: update docs to match the new type names
This commit is contained in:
parent
f8e6cd3465
commit
c85f085062
9
lib/tests/modules/declare-int-between-value.nix
Normal file
9
lib/tests/modules/declare-int-between-value.nix
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
value = lib.mkOption {
|
||||||
|
type = lib.types.ints.between (-21) 43;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
9
lib/tests/modules/declare-int-unsigned-value.nix
Normal file
9
lib/tests/modules/declare-int-unsigned-value.nix
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
value = lib.mkOption {
|
||||||
|
type = lib.types.ints.unsigned;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
3
lib/tests/modules/define-value-int-negative.nix
Normal file
3
lib/tests/modules/define-value-int-negative.nix
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
value = -23;
|
||||||
|
}
|
3
lib/tests/modules/define-value-int-positive.nix
Normal file
3
lib/tests/modules/define-value-int-positive.nix
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
value = 42;
|
||||||
|
}
|
@ -35,19 +35,16 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
|
||||||
<para>Integer related types:</para>
|
<para>Integer-related types:</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><varname>types.int</varname></term>
|
||||||
<varname>types.ints.signed</varname>
|
<listitem><para>A signed integer.</para></listitem>
|
||||||
</term>
|
|
||||||
<listitem><para>A signed integer.
|
|
||||||
</para></listitem>
|
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<varname>types.ints{signed8, signed16, signed32}</varname>
|
<varname>types.ints.{s8, s16, s32}</varname>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Signed integers with a fixed length (8, 16 or 32 bits).
|
<para>Signed integers with a fixed length (8, 16 or 32 bits).
|
||||||
@ -60,21 +57,16 @@
|
|||||||
for 8 bits).
|
for 8 bits).
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
|
||||||
<term><varname>types.int</varname></term>
|
|
||||||
<listitem><para>A convenience alias for <literal>ints.signed</literal>.
|
|
||||||
</para></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<varname>types.ints.unsigned</varname>
|
<varname>types.ints.unsigned</varname>
|
||||||
</term>
|
</term>
|
||||||
<listitem><para>An unsigned integer (that is ≥ 0).
|
<listitem><para>An unsigned integer (that is >= 0).
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<varname>types.ints{unsigned8, unsigned16, unsigned32}</varname>
|
<varname>types.ints.{u8, u16, u32}</varname>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Unsigned integers with a fixed length (8, 16 or 32 bits).
|
<para>Unsigned integers with a fixed length (8, 16 or 32 bits).
|
||||||
@ -86,15 +78,9 @@
|
|||||||
for 8 bits).
|
for 8 bits).
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<varname>types.port</varname>
|
|
||||||
</term>
|
|
||||||
<listitem><para>A network port number (0–65635).</para></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
|
||||||
<para>String related types:</para>
|
<para>String-related types:</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
@ -123,7 +109,7 @@
|
|||||||
|
|
||||||
<section><title>Value Types</title>
|
<section><title>Value Types</title>
|
||||||
|
|
||||||
<para>Value types are type that take a value parameter.</para>
|
<para>Value types are types that take a value parameter.</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
@ -147,7 +133,7 @@
|
|||||||
</term>
|
</term>
|
||||||
<listitem><para>An integer between <replaceable>lowest</replaceable>
|
<listitem><para>An integer between <replaceable>lowest</replaceable>
|
||||||
and <replaceable>highest</replaceable> (both inclusive).
|
and <replaceable>highest</replaceable> (both inclusive).
|
||||||
Useful for e.g. creating types like <literal>types.port</literal>.
|
Useful for creating types like <literal>types.port</literal>.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
Loading…
Reference in New Issue
Block a user