aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/configuration/server/cgit/default.nix
blob: 2c0e0427e573cbcc9f6e9347139b6ab26cb5db44 (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
42
43
44
45
46
47
{ config, pkgs, ... }:

let port = 15150;
in
{
  services.nginx.virtualHosts."git.spacekookie.de" = {
    enableACME = false;
    useACMEHost = "spacekookie.de";
    forceSSL = true;
    locations."/" = {
      proxyPass = "http://localhost:${builtins.toString port}";
    };
    locations."/static/" = {
      alias = "/var/lib/cgit/";
    };
  };
  
  # cgit server
  services.lighttpd = {
    enable = true;
    inherit port;
    
    cgit = {
      enable = true;
      configText = ''
        clone-prefix=https://git.spacekookie.de
        css=/static/cgit.css
        favicon=/static/favicon.ico
        enable-commit-graph=1
        enable-follow-links=1
        enable-log-filecount=1
        enable-log-linecount=1
        enable-git-config=1
        remove-suffix=1
        readme=:README
        readme=:README.md
        about-filter=${pkgs.cgit}/lib/cgit/filters/about-formatting.sh
        source-filter=${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py
        root-title=git.spacekookie.de
        root-desc=Here be really bad source code yarrr
        scan-path=/home/spacekookie/git
      '';
      subdir = ""; # be on git.spacekookie.de
    };
  };

}