nixos-hetzner/forgejo.nix
2026-10-08 22:23:22 +02:00

42 lines
952 B
Nix

{ pkgs, ... }: {
services.mysql = {
enable = true;
package = pkgs.mysql84;
};
services.forgejo = {
enable = true;
database = {
type = "mysql";
socket = "/run/mysqld/mysqld.sock";
createDatabase = true;
};
settings.service.DISABLE_REGISTRATION = true;
settings.server = {
DOMAIN = "forgejo.cordevelop.com";
ROOT_URL = "https://forgejo.cordevelop.com/";
HTTP_PORT = 3000;
SSH_PORT = 2222;
SSH_LISTEN_PORT = 2222;
START_SSH_SERVER = true;
};
};
security.acme = {
acceptTerms = true;
defaults.email = "freekcordemans@outlook.com";
};
services.nginx.virtualHosts."forgejo.cordevelop.com" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:3000";
extraConfig = ''
client_max_body_size 512M;
'';
};
};
networking.firewall.allowedTCPPorts = [ 80 443 3000 2222 ];
}