From 9abecf6bfe12ba9d4acb5f8a22db281c4093d037 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 10 Nov 2025 19:05:02 -0800 Subject: configure cgit --- profiles/git-server.nix | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) (limited to 'profiles/git-server.nix') diff --git a/profiles/git-server.nix b/profiles/git-server.nix index 3d34fad..d907580 100644 --- a/profiles/git-server.nix +++ b/profiles/git-server.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { services.gitolite = { enable = true; @@ -9,7 +9,7 @@ # Make dirs/files group readable, needed for webserver/cgit. (Default # setting is 0077.) $RC{UMASK} = 0027; - $RC{GIT_CONFIG_KEYS} = 'cgit.desc cgit.hide cgit.ignore cgit.owner'; + $RC{GIT_CONFIG_KEYS} = 'cgit.desc cgit.hide cgit.ignore cgit.owner cgit.section'; $RC{LOCAL_CODE} = "$rc{GL_ADMIN_BASE}/local"; push( @{$RC{ENABLE}}, 'symbolic-ref' ); ''; @@ -24,4 +24,45 @@ ''}" ]; + services.cgit.main = { + enable = true; + package = pkgs.cgit-pink; + user = "git"; + group = "git"; + nginx.virtualHost = "code.fcuny.net"; + scanPath = "/var/lib/gitolite/repositories"; + settings = { + css = "/cgit.css"; + logo = "/cgit.png"; + favicon = "/favicon.ico"; + robots = "noindex, nofollow"; + readme = [ + ":README.md" + ":README.org" + ]; + project-list = "/var/lib/gitolite/projects.list"; + about-filter = "${pkgs.cgit-pink}/lib/cgit/filters/about-formatting.sh"; + source-filter = "${pkgs.cgit-pink}/lib/cgit/filters/syntax-highlighting.py"; + clone-url = (lib.concatStringsSep " " [ "https://code.fcuny.net/$CGIT_REPO_URL" ]); + enable-log-filecount = 1; + enable-log-linecount = 1; + enable-git-config = 1; + enable-blame = 1; + enable-commit-graph = 1; + enable-follow-links = 1; + enable-index-owner = 0; + enable-index-links = 1; + enable-remote-branches = 1; + enable-subject-links = 1; + remove-suffix = 1; + enable-tree-linenumbers = 1; + max-atom-items = 108; + max-commit-count = 250; + max-repo-count = 500; + repository-sort = "age"; + snapshots = "tar.gz"; + root-title = "¯\\_(ツ)_/¯"; + root-desc = "source code of my various projects"; + }; + }; } -- cgit v1.2.3