summaryrefslogtreecommitdiff
path: root/os/kay/modules/cgit.nix
blob: 254cc806911e3df4133476c186481a4b6947b3ca (plain) (blame)
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
{ config, pkgs, ... }:

let
  domain = config.global.userdata.domain;
  user = config.global.userdata.name;
in
{
  users.users.${user}.packages = with pkgs; [ git ];
  environment.systemPackages = with pkgs; [
    luajitPackages.luaossl
    lua52Packages.luaossl
  ];

  services.cgit."git.${domain}" = {
    enable = true;
    nginx.virtualHost = "git.${domain}";
    scanPath = "/var/lib/git";
    settings = {
      project-list = "/var/lib/git/project.list";
      remove-suffix = 1;
      enable-commit-graph = 1;
      root-title = "${user}'s git repository";
      root-desc = "how do i learn github anon";
      source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py";
      about-filter = "${pkgs.cgit}/lib/cgit/filters/about-formatting.sh";
      readme = ":README.md";
      footer = "";
      enable-blame = 1;
      clone-url = "https://git.${domain}/$CGIT_REPO_URL";
      enable-log-filecount = 1;
      enable-log-linecount = 1;
    };
  };
}