guixsd-config

GuixSD configs for my systems
Log | Files | Refs

commit 990454ec7eb549a0084ec7d88ba740ec796e2d02
parent ed385213ba26f9008802ef955548c0274d9fc437
Author: Vineet Kumar <git@vineetk.net>
Date:   Tue, 19 May 2026 14:02:11 -0400

saklas: setup readonly git-http-backend for smart https cloning

required by libgit2 since they're not fully compatible with main git
like not supporting dumb cloning

Diffstat:
Mepistemia/systems/saklas.scm | 27+++++++++++++++++++++++++++
1 file changed, 27 insertions(+), 0 deletions(-)

diff --git a/epistemia/systems/saklas.scm b/epistemia/systems/saklas.scm @@ -432,6 +432,20 @@ rpz: activation-service-type #~(when (file-exists? "/data/src/bare") (chmod "/data/src/bare" #o775))) + (simple-service 'git-mirror-update + shepherd-root-service-type + (list (shepherd-timer + '(git-mirror-update) + "0 */8 * * *" ; vixie cron doesn't support random/tilde. I'm sorry codeberg and other mirrors :( + #~("/run/privileged/bin/su" "git" "-c" + "for i in $(dirname $(grep -l Mirrors /data/src/bare/*.git/cgitrc)); do (cd \"$i\"; git fetch upstream --prune); done") + #:requirement '(networking) + #:documentation "Update git mirrors every 8 hours."))) + (service fcgiwrap-service-type + (fcgiwrap-configuration + (user "git") + (group "git") + (socket "tcp:127.0.0.1:9000"))) (service cgit-service-type (cgit-configuration (enable-index-links? #t) @@ -457,6 +471,19 @@ rpz: (locations (list (nginx-location-configuration + (uri "~ \"^/(?<repo>.+?)(\\.git)?/(?<gitpath>(?:HEAD|info/refs|objects/(?:info/[^/]+|[0-9a-f]{2}/[0-9a-f]{38}|pack/pack-[0-9a-f]{40}\\.(?:pack|idx))|git-upload-pack))$\"") + (body (list #~(string-append "fastcgi_param SCRIPT_FILENAME " #$(file-append git "/libexec/git-core/git-http-backend") ";") + "fastcgi_param GIT_PROJECT_ROOT /data/src/bare;" + "fastcgi_param PATH_INFO /$repo.git/$gitpath;" + "fastcgi_param GIT_HTTP_EXPORT_ALL \"\";" + "fastcgi_param REMOTE_USER $remote_user;" + "fastcgi_param QUERY_STRING $args;" + "fastcgi_param REQUEST_METHOD $request_method;" + "fastcgi_param CONTENT_TYPE $content_type;" + "fastcgi_param CONTENT_LENGTH $content_length;" + "fastcgi_param HTTP_HOST $server_name;" + "fastcgi_pass 127.0.0.1:9000;"))) + (nginx-location-configuration (uri "@cgit") (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;" "fastcgi_param PATH_INFO $uri;"