Merge pull request #48687 from danielrutz/port-type

Add port type
This commit is contained in:
Silvan Mosberger 2018-11-10 15:12:07 +01:00 committed by GitHub
commit e468a1091b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 2 deletions

View File

@ -169,6 +169,9 @@ rec {
# s32 = sign 32 4294967296; # s32 = sign 32 4294967296;
}; };
# Alias of u16 for a port number
port = ints.u16;
float = mkOptionType rec { float = mkOptionType rec {
name = "float"; name = "float";
description = "floating point number"; description = "floating point number";

View File

@ -106,7 +106,7 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry xml:id='types.ints.ux'>
<term> <term>
<varname>types.ints.{u8, u16, u32}</varname> <varname>types.ints.{u8, u16, u32}</varname>
</term> </term>
@ -131,6 +131,17 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<varname>types.port</varname>
</term>
<listitem>
<para>
A port number. This type is an alias to
<link linkend='types.ints.ux'><varname>types.ints.u16</varname></link>.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
<para> <para>

View File

@ -130,7 +130,7 @@ in
}; };
ports = mkOption { ports = mkOption {
type = types.listOf types.int; type = types.listOf types.port;
default = [22]; default = [22];
description = '' description = ''
Specifies on which ports the SSH daemon listens. Specifies on which ports the SSH daemon listens.