{ 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}"; }