nixdesk ssh port 2050 fixes

This commit is contained in:
xunuwu 2025-10-08 19:00:07 +02:00
parent b4be3fef4e
commit aec7b8bdde
Signed by: xun
SSH key fingerprint: SHA256:Uot/1WoAjWAeqLOHA5vYy4phhVydsH7jCPmBjaPZfgI

View file

@ -1,16 +1,15 @@
{pkgs, ...}: {
# services.openssh.ports = [22 2050];
systemd.services.port2050-natpmp = {
bindsTo = ["sshd"]; # might not work
confinement = {
enable = true;
mode = "chroot-only";
};
serviceConfig.ExecStart = ''
systemd.services.ssh-port2050-natpmp = {
bindsTo = ["sshd.socket"];
after = ["sshd.socket"];
serviceConfig.Restart = "on-failure";
serviceConfig.ExecStart = pkgs.writeScript "ssh-port2050-natpmp" ''
#!${pkgs.bash}/bin/bash
while true
do
${pkgs.libnatpmp}/bin/natpmpc -a 2050 22 tcp 60
sleep 30
${pkgs.coreutils}/bin/sleep 30
done
'';
};