🔧 enable mosh ports by default

This commit is contained in:
Ingolf Wagner 2025-02-25 02:16:44 +07:00
parent 653c14ee0e
commit 42cdc5b508
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -36,6 +36,13 @@ in
make sure ssh is only available trough the tinc
'';
};
allowMosh = mkOption {
type = bool;
default = true;
description = ''
make mosh port available
'';
};
};
config = mkMerge [
@ -69,6 +76,16 @@ in
iptables --table nat --append PREROUTING ! --in-interface tinc.+ --protocol tcp --match tcp --dport 22 --jump REDIRECT --to-ports 0
'';
})
(mkIf (cfg.allowMosh && cfg.enable) {
networking.firewall.allowedUDPPortRanges = [
{
from = 60000;
to = 61000;
}
];
})
];
}