From 52898b111a13973517c98a7cfec67c251a168759 Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 29 Dec 2024 15:08:38 +0100 Subject: Make some of the cgit colors a bit more presentable :) Signed-off-by: Mel --- services/cgit.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'services/cgit.nix') diff --git a/services/cgit.nix b/services/cgit.nix index 116a3de..73bfbe4 100644 --- a/services/cgit.nix +++ b/services/cgit.nix @@ -5,7 +5,19 @@ let inherit (pkgs) dockerTools; inherit (auxiliaryPkgs) common; - cgit = pkgs.cgit-pink; + # https://pygments.org/styles/ + cgitDefaultStyle = "pastie"; + cgitNewStyle = "rrt"; + + cgit = pkgs.cgit-pink.overrideAttrs (attrs: { + postPatch = attrs.postPatch + '' + substituteInPlace filters/syntax-highlighting.py filters/html-converters/md2html \ + --replace-fail '${cgitDefaultStyle}' '${cgitNewStyle}' + + # remove all lines with color, to use the default ones + sed -i -n "/color/!p" filters/html-converters/md2html + ''; + }); cgitLocalPort = 3792; cgitDir = "/srv/cgit"; -- cgit 1.4.1