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