From 317fb8c83cf4c1006fc9a958cc904dd7e35d40f3 Mon Sep 17 00:00:00 2001 From: "quentin@aristote.fr" Date: Thu, 29 Jan 2026 15:17:45 +0100 Subject: cgit: add syntax highlighting --- config/services/git/web/cgit.css | 2 +- config/services/git/web/default.nix | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'config/services/git') diff --git a/config/services/git/web/cgit.css b/config/services/git/web/cgit.css index 00b8a1e..fde27cc 100644 --- a/config/services/git/web/cgit.css +++ b/config/services/git/web/cgit.css @@ -935,4 +935,4 @@ div#cgit table.ssdiff td.space div { div#cgit div.cgit-panel { float: left; } - } \ No newline at end of file +} \ No newline at end of file diff --git a/config/services/git/web/default.nix b/config/services/git/web/default.nix index f5c8251..6537970 100644 --- a/config/services/git/web/default.nix +++ b/config/services/git/web/default.nix @@ -1,4 +1,9 @@ -{ config, lib, ... }: +{ + config, + lib, + pkgs, + ... +}: let virtualHost = "${config.networking.hostName}.aristote.mesh"; in @@ -11,17 +16,16 @@ in inherit virtualHost; location = "/git/"; }; - extraConfig = '' - root-title=repositories - root-desc=by Quentin Aristote - head-include=${./head.html} - ''; + settings = { + head-include = "${./head.html}"; + root-title = "repositories"; + root-desc = "by Quentin Aristote"; + source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py"; + }; }; services.nginx.virtualHosts."${virtualHost}".locations."= /git/cgit.css".alias = lib.mkForce ./cgit.css; # give access to the repos users.users.cgit.extraGroups = [ "git" ]; - - systemd.services.fcgiwrap-cgit-default.personal.monitor = true; } -- cgit v1.2.3