diff --git a/modules/services/forgejo/default.nix b/modules/services/forgejo/default.nix index 3720d58..a7a1f07 100644 --- a/modules/services/forgejo/default.nix +++ b/modules/services/forgejo/default.nix @@ -1,6 +1,29 @@ -{ - services.forgejo.enable = true; - services.forgejo.settings.server.HTTP_PORT = 2000; - services.forgejo.settings.server.DOMAIN = "git.joygnu.org"; - services.forgejo.settings.server.PROTOCOL = "https"; +{config, ...}: let + cfg = config.services.forgejo; + srv = cfg.settings.server; +in { + services.nginx = { + virtualHosts.${cfg.settings.server.DOMAIN} = { + forceSSL = true; + enableACME = true; + extraConfig = '' + client_max_body_size 512M; + ''; + locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}"; + }; + }; + + services.forgejo = { + enable = true; + lfs.enable = true; + # user = "git"; + settings = { + server = { + DOMAIN = "git.joygnu.org"; + ROOT_URL = "https://${srv.DOMAIN}/"; + HTTP_PORT = 2000; + }; + service.DISABLE_REGISTRATION = true; + }; + }; }