summaryrefslogtreecommitdiff
path: root/modules/nixos/forgejo.nix
blob: c7c0718e391a0659dabe483d8ad5128ea36b6072 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{config, ...}: {
  services.nginx = {
    virtualHosts.${config.services.forgejo.settings.server.DOMAIN} = {
      forceSSL = true;
      enableACME = true;
      extraConfig = ''
        client_max_body_size 512M
      '';
      locations."/".proxyPass = "https://localhost:${builtins.toString config.services.forgejo.settings.server.HTTP_PORT}";
    };
  };
  services.forgejo = {
    enable = true;
    database.type = "postgres";
    lfs.enable = true;
    settings = {
      server = rec {
        DOMAIN = "git.galaxious.de";
        ROOT_URL = "https://${DOMAIN}";
        HTTP_PORT = 4043;
        SSH_PORT = 4022;
      };
      service.DISABLE_REGISTRATION = false;
    };
  };
  services.openssh.ports = [config.services.forgejo.settings.server.SSH_PORT];
}