From ed4f66185f93cf5e33fb1e53fb669da74364a9b6 Mon Sep 17 00:00:00 2001
From: Robert Helgesson <robert@rycee.net>
Date: Mon, 19 Aug 2019 20:37:48 +0200
Subject: [PATCH] Use `types.port` where applicable

This changes the type of all options that specify ports to
`types.port`. This type restricts values to between 0 and 65535.
---
 modules/accounts/email.nix   | 4 ++--
 modules/programs/irssi.nix   | 2 +-
 modules/programs/ssh.nix     | 2 +-
 modules/services/mpd.nix     | 2 +-
 modules/services/mpdris2.nix | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/accounts/email.nix b/modules/accounts/email.nix
index 71ecd3020..cc9d0dc28 100644
--- a/modules/accounts/email.nix
+++ b/modules/accounts/email.nix
@@ -95,7 +95,7 @@ let
       };
 
       port = mkOption {
-        type = types.nullOr types.ints.positive;
+        type = types.nullOr types.port;
         default = null;
         example = 993;
         description = ''
@@ -125,7 +125,7 @@ let
       };
 
       port = mkOption {
-        type = types.nullOr types.ints.positive;
+        type = types.nullOr types.port;
         default = null;
         example = 465;
         description = ''
diff --git a/modules/programs/irssi.nix b/modules/programs/irssi.nix
index ad9a642eb..fc8fa8e61 100644
--- a/modules/programs/irssi.nix
+++ b/modules/programs/irssi.nix
@@ -101,7 +101,7 @@ let
         };
 
         port = mkOption {
-          type = types.int;
+          type = types.port;
           default = 6667;
           description = "Port of the chat server.";
         };
diff --git a/modules/programs/ssh.nix b/modules/programs/ssh.nix
index bf6677cd9..c6e09bda9 100644
--- a/modules/programs/ssh.nix
+++ b/modules/programs/ssh.nix
@@ -21,7 +21,7 @@ let
       };
 
       port = mkOption {
-        type = types.nullOr types.int;
+        type = types.nullOr types.port;
         default = null;
         description = "Specifies port number to connect on remote host.";
       };
diff --git a/modules/services/mpd.nix b/modules/services/mpd.nix
index 822d2fe39..fbcf9e942 100644
--- a/modules/services/mpd.nix
+++ b/modules/services/mpd.nix
@@ -98,7 +98,7 @@ in {
         };
 
         port = mkOption {
-          type = types.ints.positive;
+          type = types.port;
           default = 6600;
           description = ''
             The TCP port on which the the daemon will listen.
diff --git a/modules/services/mpdris2.nix b/modules/services/mpdris2.nix
index 14c890230..51ce7e892 100644
--- a/modules/services/mpdris2.nix
+++ b/modules/services/mpdris2.nix
@@ -56,7 +56,7 @@ in
       };
 
       port = mkOption {
-        type = types.ints.positive;
+        type = types.port;
         default = config.services.mpd.network.port;
         defaultText = "config.services.mpd.network.port";
         description = ''