diff options
-rw-r--r-- | lib/types.nix | 3 | ||||
-rw-r--r-- | nixos/doc/manual/development/option-types.xml | 13 | ||||
-rw-r--r-- | nixos/modules/services/networking/ssh/sshd.nix | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/lib/types.nix b/lib/types.nix index ca6794e274c3..d1ece2402ad7 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -169,6 +169,9 @@ rec { # s32 = sign 32 4294967296; }; + # Alias of u16 for a port number + port = ints.u16; + float = mkOptionType rec { name = "float"; description = "floating point number"; diff --git a/nixos/doc/manual/development/option-types.xml b/nixos/doc/manual/development/option-types.xml index e6c9eae11a72..d993e47bc914 100644 --- a/nixos/doc/manual/development/option-types.xml +++ b/nixos/doc/manual/development/option-types.xml @@ -106,7 +106,7 @@ </para> </listitem> </varlistentry> - <varlistentry> + <varlistentry xml:id='types.ints.ux'> <term> <varname>types.ints.{u8, u16, u32}</varname> </term> @@ -131,6 +131,17 @@ </para> </listitem> </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> <para> diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index c16fbe8a52fa..5fab79f1b3d7 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -130,7 +130,7 @@ in }; ports = mkOption { - type = types.listOf types.int; + type = types.listOf types.port; default = [22]; description = '' Specifies on which ports the SSH daemon listens. |