aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2025-09-16 18:09:50 +0200
committerMartin Fischer <martin@push-f.com>2025-09-16 18:09:53 +0200
commit6777e059414701107f77c62cdd32435d27047c2e (patch)
tree005c12f9dd8ac2d6f1c95f3e4db1e64d29508331 /nixos
parent4af4fad9c06c077679b556e6e6d7641b7bd5b654 (diff)
feat(tente): make cgit render README.md files for reposHEADmaster
I already had this before migrating to Nix and lost this in the migration.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/hosts/tente/git.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/hosts/tente/git.nix b/nixos/hosts/tente/git.nix
index c5c6478..49ecff0 100644
--- a/nixos/hosts/tente/git.nix
+++ b/nixos/hosts/tente/git.nix
@@ -47,6 +47,19 @@ in
enable-git-config = 1;
root-title = "push-f.com repositories";
root-desc = "My various repositories.";
+ readme = ":README.md";
+ about-filter =
+ # about-formatting.sh from cgit uses python-markdown which doesn't
+ # follow CommonMark, so we're using the lowdown parser instead.
+ let
+ # The about-filter is invoked with stdin but also with the filename
+ # as argv[1] so we wrap lowdown in a script to ignore the argument.
+ formatScript = pkgs.writeScriptBin "about-format.sh" ''
+ #!/bin/sh
+ ${pkgs.lowdown}/bin/lowdown
+ '';
+ in
+ "${formatScript}/bin/about-format.sh";
enable-index-owner = 0;
source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py";
clone-prefix = "https://${cfg.webUiDomain}";