{ pkgs, ... }: let cgitFooter = pkgs.writeText "cgit-footer.html" '' ''; spectrumReadme = pkgs.writeText "about.html" ''

Contributing to Spectrum

Want to contribute to Spectrum? We'd love to have you. Have a look at the online documentation.

''; sourceFilter = pkgs.runCommandNoCC "source-filter" { nativeBuildInputs = with pkgs; with python3.pkgs; [ wrapPython ]; } '' mkdir -p $out/bin sed s/pastie/friendly/g >$out/bin/syntax-highlighting.py \ <${pkgs.cgit}/lib/cgit/filters/.syntax-highlighting.py-wrapped chmod +x $out/bin/syntax-highlighting.py wrapPythonPrograms ''; in { imports = [ ../../cgit ]; services.cgit.instances.spectrum = { vhost = "spectrum-os.org"; path = "/git"; config = pkgs.writeText "cgit.conf" '' clone-prefix=https://spectrum-os.org/git css=/git/cgit.css enable-blame=1 enable-commit-graph=1 enable-follow-links=1 enable-git-config=1 enable-index-owner=0 favicon=https://spectrum-os.org/logo/logo_html.svg footer=${cgitFooter} logo= remove-suffix=1 root-desc=Web interface for Spectrum source code root-readme=${spectrumReadme} root-title=Spectrum Git Repository Browser snapshots=all about-filter=${pkgs.cgit}/lib/cgit/filters/about-formatting.sh source-filter=${sourceFilter}/bin/syntax-highlighting.py scan-path=/home/spectrum/git ''; }; }