summaryrefslogtreecommitdiff
path: root/config/services/git/web/default.nix
blob: 8e9256ed1509eec57e9134d920c7477036b92e89 (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
{
  config,
  lib,
  pkgs,
  ...
}:
let
  virtualHost = "${config.networking.hostName}.aristote.mesh";
in
{
  services.cgit.default = {
    enable = true;
    scanPath = "/srv/git";
    gitHttpBackend.enable = false;
    nginx = {
      inherit virtualHost;
      location = "/git/";
    };
    settings = {
      head-include = "${./head.html}";
      root-title = "repositories";
      root-desc = "by Quentin Aristote";
      source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py";
      clone-prefix = "https://git.aristote.fr";
      section-from-path = 1;
    };
  };
  services.nginx.virtualHosts."${virtualHost}".locations."= /git/cgit.css".alias =
    lib.mkForce ./cgit.css;

  # give access to the repos
  users.users.cgit.extraGroups = [ "git" ];
}