From cf540f8c9840457ed90a315dd635bceecb78495a Mon Sep 17 00:00:00 2001 From: Haylin Moore Date: Mon, 8 Sep 2025 15:27:19 +0200 Subject: [PATCH] treewide/nixos: move number typed port options to types.port --- nixos/modules/services/cluster/hadoop/hbase.nix | 4 ++-- nixos/modules/services/databases/monetdb.nix | 2 +- nixos/modules/services/development/athens.nix | 4 ++-- nixos/modules/services/games/minetest-server.nix | 2 +- nixos/modules/services/mail/postgrey.nix | 2 +- nixos/modules/services/misc/headphones.nix | 2 +- nixos/modules/services/misc/moonraker.nix | 2 +- nixos/modules/services/misc/servarr/settings-options.nix | 2 +- nixos/modules/services/misc/sickbeard.nix | 2 +- nixos/modules/services/monitoring/statsd.nix | 4 ++-- nixos/modules/services/networking/i2pd.nix | 2 +- nixos/modules/services/networking/iperf3.nix | 2 +- nixos/modules/services/networking/nghttpx/server-options.nix | 2 +- nixos/modules/services/networking/ssh/sshd.nix | 2 +- nixos/modules/services/networking/tinyproxy.nix | 2 +- nixos/modules/services/torrent/flood.nix | 2 +- nixos/modules/services/web-apps/selfoss.nix | 2 +- nixos/modules/services/web-servers/varnish/default.nix | 2 +- nixos/modules/virtualisation/waagent.nix | 2 +- 19 files changed, 22 insertions(+), 22 deletions(-) diff --git a/nixos/modules/services/cluster/hadoop/hbase.nix b/nixos/modules/services/cluster/hadoop/hbase.nix index 06af0a21811e..fc5261a7268e 100644 --- a/nixos/modules/services/cluster/hadoop/hbase.nix +++ b/nixos/modules/services/cluster/hadoop/hbase.nix @@ -178,12 +178,12 @@ in let ports = port: infoPort: { port = lib.mkOption { - type = lib.types.int; + type = lib.types.port; default = port; description = "RPC port"; }; infoPort = lib.mkOption { - type = lib.types.int; + type = lib.types.port; default = infoPort; description = "web UI port"; }; diff --git a/nixos/modules/services/databases/monetdb.nix b/nixos/modules/services/databases/monetdb.nix index 9fc79e495678..530acc504f90 100644 --- a/nixos/modules/services/databases/monetdb.nix +++ b/nixos/modules/services/databases/monetdb.nix @@ -38,7 +38,7 @@ in }; port = lib.mkOption { - type = lib.types.ints.u16; + type = lib.types.port; default = 50000; description = "Port to listen on."; }; diff --git a/nixos/modules/services/development/athens.nix b/nixos/modules/services/development/athens.nix index bd770293e4c7..1f41a269e11b 100644 --- a/nixos/modules/services/development/athens.nix +++ b/nixos/modules/services/development/athens.nix @@ -861,7 +861,7 @@ in default = "localhost"; }; port = lib.mkOption { - type = lib.types.int; + type = lib.types.port; description = "Port for the MySQL database."; default = 3306; }; @@ -901,7 +901,7 @@ in default = "localhost"; }; port = lib.mkOption { - type = lib.types.int; + type = lib.types.port; description = "Port for the Postgres database."; default = 5432; }; diff --git a/nixos/modules/services/games/minetest-server.nix b/nixos/modules/services/games/minetest-server.nix index 5b9fe630a729..d1718d3bca9d 100644 --- a/nixos/modules/services/games/minetest-server.nix +++ b/nixos/modules/services/games/minetest-server.nix @@ -135,7 +135,7 @@ in }; port = lib.mkOption { - type = lib.types.nullOr lib.types.int; + type = lib.types.nullOr lib.types.port; default = null; description = '' Port number to bind to. diff --git a/nixos/modules/services/mail/postgrey.nix b/nixos/modules/services/mail/postgrey.nix index d655839162b1..53c54c15c5d0 100644 --- a/nixos/modules/services/mail/postgrey.nix +++ b/nixos/modules/services/mail/postgrey.nix @@ -26,7 +26,7 @@ let description = "The address to bind to. Localhost if null"; }; port = mkOption { - type = natural'; + type = port; default = 10030; description = "Tcp port to bind to"; }; diff --git a/nixos/modules/services/misc/headphones.nix b/nixos/modules/services/misc/headphones.nix index 8440c114ca72..d637acb292bd 100644 --- a/nixos/modules/services/misc/headphones.nix +++ b/nixos/modules/services/misc/headphones.nix @@ -42,7 +42,7 @@ in description = "Host to listen on."; }; port = lib.mkOption { - type = lib.types.ints.u16; + type = lib.types.port; default = 8181; description = "Port to bind to."; }; diff --git a/nixos/modules/services/misc/moonraker.nix b/nixos/modules/services/misc/moonraker.nix index f1fcc255704b..53b69a729f27 100644 --- a/nixos/modules/services/misc/moonraker.nix +++ b/nixos/modules/services/misc/moonraker.nix @@ -75,7 +75,7 @@ in }; port = lib.mkOption { - type = lib.types.ints.unsigned; + type = lib.types.port; default = 7125; description = "The port to listen on."; }; diff --git a/nixos/modules/services/misc/servarr/settings-options.nix b/nixos/modules/services/misc/servarr/settings-options.nix index 007deba75425..0dc39b9d4c06 100644 --- a/nixos/modules/services/misc/servarr/settings-options.nix +++ b/nixos/modules/services/misc/servarr/settings-options.nix @@ -26,7 +26,7 @@ }; server = { port = lib.mkOption { - type = lib.types.int; + type = lib.types.port; description = "Port Number"; default = port; }; diff --git a/nixos/modules/services/misc/sickbeard.nix b/nixos/modules/services/misc/sickbeard.nix index 7c6205c7793a..7eaa04d7068e 100644 --- a/nixos/modules/services/misc/sickbeard.nix +++ b/nixos/modules/services/misc/sickbeard.nix @@ -44,7 +44,7 @@ in description = "Path to config file."; }; port = lib.mkOption { - type = lib.types.ints.u16; + type = lib.types.port; default = 8081; description = "Port to bind to."; }; diff --git a/nixos/modules/services/monitoring/statsd.nix b/nixos/modules/services/monitoring/statsd.nix index 43462a95ccae..5eb0517d4fc5 100644 --- a/nixos/modules/services/monitoring/statsd.nix +++ b/nixos/modules/services/monitoring/statsd.nix @@ -73,7 +73,7 @@ in port = lib.mkOption { description = "Port that stats listens for messages on over UDP"; default = 8125; - type = lib.types.int; + type = lib.types.port; }; mgmt_address = lib.mkOption { @@ -85,7 +85,7 @@ in mgmt_port = lib.mkOption { description = "Port to run the management TCP interface on"; default = 8126; - type = lib.types.int; + type = lib.types.port; }; backends = lib.mkOption { diff --git a/nixos/modules/services/networking/i2pd.nix b/nixos/modules/services/networking/i2pd.nix index d93f8c61629e..1f9c9dcac4a0 100644 --- a/nixos/modules/services/networking/i2pd.nix +++ b/nixos/modules/services/networking/i2pd.nix @@ -417,7 +417,7 @@ in }; port = mkOption { - type = with types; nullOr int; + type = with types; nullOr port; default = null; description = '' I2P listen port. If no one is given the router will pick between 9111 and 30777. diff --git a/nixos/modules/services/networking/iperf3.nix b/nixos/modules/services/networking/iperf3.nix index 6bcf17306e1d..173d3e6d962b 100644 --- a/nixos/modules/services/networking/iperf3.nix +++ b/nixos/modules/services/networking/iperf3.nix @@ -12,7 +12,7 @@ let enable = mkEnableOption "iperf3 network throughput testing server"; package = mkPackageOption pkgs "iperf3" { }; port = mkOption { - type = types.ints.u16; + type = types.port; default = 5201; description = "Server port to listen on for iperf3 client requests."; }; diff --git a/nixos/modules/services/networking/nghttpx/server-options.nix b/nixos/modules/services/networking/nghttpx/server-options.nix index 19e03cac557d..ebff829e8412 100644 --- a/nixos/modules/services/networking/nghttpx/server-options.nix +++ b/nixos/modules/services/networking/nghttpx/server-options.nix @@ -9,7 +9,7 @@ ''; }; port = lib.mkOption { - type = lib.types.int; + type = lib.types.port; example = 5088; description = '' Server host port. diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index 76198d6337c8..4b3ab053be7d 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -319,7 +319,7 @@ in ''; }; port = lib.mkOption { - type = lib.types.nullOr lib.types.int; + type = lib.types.nullOr lib.types.port; default = null; description = '' Port to listen to. diff --git a/nixos/modules/services/networking/tinyproxy.nix b/nixos/modules/services/networking/tinyproxy.nix index 5712f7949ef0..4b3d1e425f4c 100644 --- a/nixos/modules/services/networking/tinyproxy.nix +++ b/nixos/modules/services/networking/tinyproxy.nix @@ -70,7 +70,7 @@ in ''; }; Port = mkOption { - type = types.int; + type = types.port; default = 8888; description = '' Specify which port to listen to. diff --git a/nixos/modules/services/torrent/flood.nix b/nixos/modules/services/torrent/flood.nix index a623c62b4400..658ce55939f6 100644 --- a/nixos/modules/services/torrent/flood.nix +++ b/nixos/modules/services/torrent/flood.nix @@ -19,7 +19,7 @@ in description = "Whether to open the firewall for the port in {option}`services.flood.port`."; }; port = lib.mkOption { - type = lib.types.int; + type = lib.types.port; description = "Port to bind webserver."; default = 3000; example = 3001; diff --git a/nixos/modules/services/web-apps/selfoss.nix b/nixos/modules/services/web-apps/selfoss.nix index 47ca75f00794..c3dceb859fea 100644 --- a/nixos/modules/services/web-apps/selfoss.nix +++ b/nixos/modules/services/web-apps/selfoss.nix @@ -100,7 +100,7 @@ in }; port = mkOption { - type = types.nullOr types.int; + type = types.nullOr types.port; default = null; description = '' The database's port. If not set, the default ports will be diff --git a/nixos/modules/services/web-servers/varnish/default.nix b/nixos/modules/services/web-servers/varnish/default.nix index f42ed39ece80..0f1217fa9b35 100644 --- a/nixos/modules/services/web-servers/varnish/default.nix +++ b/nixos/modules/services/web-servers/varnish/default.nix @@ -80,7 +80,7 @@ let port = mkOption { description = "The port to use for IP sockets. If port is not specified, port 80 (http) is used."; default = null; - type = with types; nullOr int; + type = with types; nullOr port; }; proto = mkOption { description = "PROTO can be 'HTTP' (the default) or 'PROXY'. Both version 1 and 2 of the proxy protocol can be used."; diff --git a/nixos/modules/virtualisation/waagent.nix b/nixos/modules/virtualisation/waagent.nix index bb63506efa08..407aa261b764 100644 --- a/nixos/modules/virtualisation/waagent.nix +++ b/nixos/modules/virtualisation/waagent.nix @@ -220,7 +220,7 @@ let }; Port = lib.mkOption { - type = types.nullOr types.int; + type = types.nullOr types.port; default = null; description = '' If you set http proxy, waagent will use this proxy to access the Internet.