aboutsummaryrefslogtreecommitdiff
path: root/modules/git/default.nix
blob: 08b26722d798cfdf8d8060c3b5ccae3408edf630 (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
28
29
30
31
32
33
34
35
36
37
{ self, config, lib, pkgs, ... }:

{
  environment.systemPackages = [ pkgs.gitea ];

  services.gitea = {
    enable = true;
    stateDir = "/var/lib/gitea";

    appName = "Vapor Git: producing vaporware since 1999";
    database = {
      type = "postgres";
      name = "gitea";
      user = "gitea";
      createDatabase = true;
    };

    settings.server = {
      DOMAIN = "git.vapor.systems";
      ROOT_URL = "https://git.vapor.systems";
      PROTOCOL = "http+unix";
      HTTP_ADDR = "/run/gitea/http.sock";
    };
  };

  security.acme.certs = {
    "vapor.systems" = {
      extraDomainNames = [ "*.vapor.systems" ];
    };
  };

  services.nginx = {
    enable = true;
    virtualHosts."git.vapor.systems" =
      self.lib.nginx.proxyDomain "vapor.systems" "http://unix:/run/gitea/http.sock";
  };
}