2024-11-28 01:14:34 +08:00
|
|
|
{ config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.networking.ports;
|
|
|
|
noCollision = l: length (unique l) == length l;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.networking.ports = mkOption {
|
|
|
|
type = with types; attrsOf port;
|
|
|
|
default = {
|
2024-12-07 02:08:39 +08:00
|
|
|
# standard ports
|
2024-12-19 21:26:19 +08:00
|
|
|
smtp = 25;
|
2024-12-20 16:06:23 +08:00
|
|
|
dns = 53;
|
2024-11-28 01:14:34 +08:00
|
|
|
http = 80;
|
|
|
|
https = 443;
|
2024-12-19 21:26:19 +08:00
|
|
|
smtp-tls = 465;
|
2024-12-20 16:06:23 +08:00
|
|
|
smtp-submission = 587;
|
2024-12-19 21:26:19 +08:00
|
|
|
imap-tls = 993;
|
2024-12-07 02:08:39 +08:00
|
|
|
socks = 1080;
|
2024-11-28 01:14:34 +08:00
|
|
|
ssh = 2222;
|
|
|
|
|
2024-12-07 02:08:39 +08:00
|
|
|
# local ports
|
|
|
|
enthalpy-gost = 3000;
|
2024-12-15 01:20:55 +08:00
|
|
|
ntfy = 4000;
|
2024-12-15 02:52:27 +08:00
|
|
|
keycloak = 4010;
|
2024-12-17 16:32:59 +08:00
|
|
|
miniflux = 4020;
|
2024-12-18 16:36:47 +08:00
|
|
|
matrix-synapse = 4030;
|
2024-12-18 18:54:19 +08:00
|
|
|
heisenbridge = 4031;
|
2024-12-19 00:09:09 +08:00
|
|
|
mautrix-telegram = 4032;
|
2024-12-19 21:26:19 +08:00
|
|
|
rspamd-controller = 4040;
|
|
|
|
rspamd-redis = 4041;
|
2024-12-20 16:06:23 +08:00
|
|
|
caddy-admin = 4050;
|
2024-12-21 20:04:41 +08:00
|
|
|
prometheus = 4060;
|
2024-12-22 17:17:07 +08:00
|
|
|
prometheus-alertmanager = 4061;
|
2024-12-21 20:04:41 +08:00
|
|
|
prometheus-node-exporter = 4070;
|
2024-12-22 16:34:00 +08:00
|
|
|
prometheus-blackbox-exporter = 4071;
|
2024-12-22 23:41:00 +08:00
|
|
|
prometheus-ping-exporter = 4072;
|
2025-01-01 20:11:47 +08:00
|
|
|
vaultwarden = 4080;
|
2024-12-07 02:08:39 +08:00
|
|
|
|
|
|
|
# public ports
|
2024-12-13 18:02:22 +08:00
|
|
|
enthalpy-wireguard-reimu-aston = 13101;
|
2024-12-21 13:36:14 +08:00
|
|
|
enthalpy-ipsec = 14000;
|
2024-11-28 01:14:34 +08:00
|
|
|
};
|
|
|
|
readOnly = true;
|
|
|
|
description = ''
|
|
|
|
A mapping of network ports, each identified by a unique name.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
assertions = singleton {
|
|
|
|
assertion = noCollision (attrValues cfg);
|
|
|
|
message = "port collision";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|