summaryrefslogtreecommitdiffstats
path: root/configs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-16 15:57:58 +0000
committertv <tv@krebsco.de>2026-11-16 17:04:38 +0100
commita3779be84d71414ce1500ee80a2a2d0f69dbee2f (patch)
tree7b48038370fc2fcea0d8e41f4f2113c50d82c8eb /configs
parentbc0de470f8577aca5a299df2698b4edcb3a4e0fd (diff)
sshd: add cfg.ssh.port
Diffstat (limited to 'configs')
-rw-r--r--configs/sshd.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/configs/sshd.nix b/configs/sshd.nix
index d99ceb5..7fdcc42 100644
--- a/configs/sshd.nix
+++ b/configs/sshd.nix
@@ -4,13 +4,15 @@
lib.optional (cfg.host.nets?mycelium) cfg.host.nets.mycelium ++
lib.optional (cfg.host.nets?retiolum) cfg.host.nets.retiolum ++
lib.optional (cfg.host.nets?wiregrill) cfg.host.nets.wiregrill;
+
+ cfg.ssh.port = 11423;
in {
services.openssh = {
enable = true;
};
tv.iptables.input-internet-accept-tcp = [ "ssh" ];
tv.iptables.extra.nat.OUTPUT = [
- "-o lo -p tcp --dport 11423 -j REDIRECT --to-ports 22"
+ "-o lo -p tcp --dport ${toString cfg.ssh.port} -j REDIRECT --to-ports 22"
];
tv.iptables.extra4.nat.PREROUTING =
map
@@ -22,6 +24,6 @@ in {
(builtins.filter (net: net.ip6 != null) nets);
tv.iptables.extra.nat.PREROUTING = [
"-p tcp --dport 22 -j REDIRECT --to-ports 0"
- "-p tcp --dport 11423 -j REDIRECT --to-ports 22"
+ "-p tcp --dport ${toString cfg.ssh.port} -j REDIRECT --to-ports 22"
];
}