diff --git a/nixos/boxes/vpsfree1/gitea.nix b/nixos/boxes/vpsfree1/gitea.nix index 997cd529..9d215878 100644 --- a/nixos/boxes/vpsfree1/gitea.nix +++ b/nixos/boxes/vpsfree1/gitea.nix @@ -1,14 +1,15 @@ { config, pkgs, inputs, lib, ... }: let httpPort = 8083; - sshPort = 2222; + sshContainerPort = 22222; + sshHostPort = 22; domain = "git.cyplo.dev"; baseurl = "https://${domain}"; path = "/var/lib/gitea"; in { imports = [ ../nginx.nix ]; - networking.firewall.allowedTCPPorts = [ sshPort ]; + networking.firewall.allowedTCPPorts = [ sshHostPort ]; services.nginx = { virtualHosts = { "${domain}" = { @@ -29,8 +30,8 @@ in { hostPort = httpPort; } { - containerPort = sshPort; - hostPort = sshPort; + containerPort = sshContainerPort; + hostPort = sshHostPort; } ]; bindMounts = { @@ -39,7 +40,7 @@ in { isReadOnly = false; }; }; - config = { config, pkgs, ... }: { + config = { config, pkgs, lib, ... }: { system.stateVersion = "22.05"; services.gitea = { enable = true; @@ -48,11 +49,14 @@ in { httpPort = httpPort; disableRegistration = true; stateDir = path; - ssh = { - enable = true; - clonePort = sshPort; + settings = { + server = { + START_SSH_SERVER = true; + SSH_PORT = sshHostPort; + SSH_LISTEN_PORT = sshContainerPort; + DISABLE_SSH = false; + }; }; - settings = { server = { START_SSH_SERVER = true; }; }; }; }; };