blob: c9e63c35bc9db748d65a950fef7e9e5e4d22392a (
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
|
{
config,
lib,
pkgs,
...
}:
let
virtualHost = "${config.networking.hostName}.aristote.mesh";
scanPath = "/srv/git";
gitconfig = ''
[safe]
directory = ${scanPath}/*
'';
in
{
services.cgit.default = {
enable = true;
inherit scanPath;
gitHttpBackend = {
enable = true;
checkExportOkFiles = false;
};
nginx = {
inherit virtualHost;
location = "/git/";
};
settings = {
head-include = "${./head.html}";
root-title = "repositories";
root-desc = "by Quentin Aristote";
root-readme = "${./about.html}";
source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py";
clone-prefix = "https://git.aristote.fr";
section-from-path = 1;
enable-index-owner = 0;
};
};
services.nginx.virtualHosts."${virtualHost}".locations."= /git/cgit.css".alias =
lib.mkForce ./cgit.css;
# give access to the repos
users.users.cgit.extraGroups = [ "git" ];
## for the http backend
systemd.services.fcgiwrap-cgit-default.environment.XDG_CONFIG_HOME =
"${pkgs.writeTextDir "git/config" gitconfig}";
}
|