diff options
| -rw-r--r-- | profiles/git-server.nix | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/profiles/git-server.nix b/profiles/git-server.nix index 498b681..2d45fee 100644 --- a/profiles/git-server.nix +++ b/profiles/git-server.nix @@ -1,4 +1,29 @@ { pkgs, lib, ... }: +let + cgit-org2html = pkgs.writeShellScriptBin "org2html" '' + ${pkgs.pandoc}/bin/pandoc \ + --from org \ + --to html5 \ + --sandbox=true \ + --html-q-tags \ + --ascii \ + --standalone \ + --wrap=auto \ + --embed-resources \ + -M document-css=false + ''; + about-formatting = pkgs.writeShellScriptBin "about-formatting" '' + cd "${pkgs.cgit}/lib/cgit/filters/html-converters" + case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in + *.markdown|*.mdown|*.md|*.mkd) exec ./md2html; ;; + *.rst) exec ./rst2html; ;; + *.[1-9]) exec ./man2html; ;; + *.htm|*.html) exec cat; ;; + *.txt) exec ./txt2html; ;; + *.org) exec ${cgit-org2html}/bin/org2html; ;; + esac + ''; +in { services.gitolite = { enable = true; @@ -41,7 +66,7 @@ ":README.org" ]; project-list = "/var/lib/gitolite/projects.list"; - about-filter = "${pkgs.cgit}/lib/cgit/filters/about-formatting.sh"; + about-filter = "${about-formatting}/bin/about-formatting"; source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py"; clone-url = (lib.concatStringsSep " " [ "https://code.fcuny.net/$CGIT_REPO_URL" ]); enable-log-filecount = 1; |
