summaryrefslogtreecommitdiff
path: root/modules/git/cgit.nix
blob: d5b57ec749c50f82167551fc0ecb53a1c58c6afb (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
38
39
40
41
{ config, ... }:

let
  repositoryPath = "/home/compromyse";
in {
  services.cgit = {
    enable = true;
    scanPath = repositoryPath;
    settings = {
      root-title = "compromyse: CGIT";
      root-desc = "Compromyse's Git Repositories";
      clone-url = "https://git.compromyse.xyz/$CGIT_REPO_URL";
      enable-commit-graph = 1;
      enable-log-filecount = 1;
      enable-log-linecount = 1;
    };
  };

  services.fcgiwrap.enable = true;

  services.nginx = {
    enable = true;
    virtualHosts."git.compromyse.com" = {
      # forceSSL = true;
      # enableACME = true;
      root = "${pkgs.cgit}/cgit";
      locations."/" = {
        extraConfig = ''
          include ${pkgs.cgit}/cgit/cgit.conf;
          fastcgi_pass unix:${config.services.fcgiwrap.socketAddress};
          fastcgi_param SCRIPT_FILENAME ${pkgs.cgit}/cgit/cgit.cgi;
          fastcgi_param PATH_INFO $uri;
          include ${pkgs.nginx}/conf/fastcgi_params;
        '';
      };
    };
  };

  # security.acme.acceptTerms = true;
  # security.acme.defaults.email = "raghus2247@gmail.com";
}