summaryrefslogtreecommitdiff
path: root/modules/git/cgit.nix
blob: 6a92ae416d3caeb343450f0f34a98bf8d030b9b6 (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
{ config, pkgs, ... }:

let
  repositoryPath = "/home/compromyse";
  cgit = (pkgs.callPackage ../../packages/cgit.nix {
    dist = ./cgit-dist;
  });
in {
  services.cgit."git.compromyse.xyz" = {
    enable = true;
    user = "root";
    group = "root";

    package = cgit;

    scanPath = repositoryPath;
    settings = {
      root-title = "compromyse: CGIT";
      root-desc = "Compromyse's Git Repositories";
      enable-http-clone = true;

      enable-commit-graph = true;
      enable-follow-links = true;
      source-filter = "${cgit}/lib/cgit/filters/syntax-highlighting.py";

      head-include = "/config/modules/git/cgit_theme.css";
      virtual-root = "/";
      clone-prefix = "https://git.compromyse.xyz";

      "mimetype.gif" = "image/gif";
      "mimetype.html" = "text/html";
      "mimetype.jpg" = "image/jpeg";
      "mimetype.jpeg" = "image/jpeg";
      "mimetype.pdf" = "application/pdf";
      "mimetype.png" = "image/png";
      "mimetype.svg" = "image/svg+xml";
    };
    nginx.virtualHost = "git.compromyse.xyz";
  };
}