From 9f9c7a108ddb4a2d071958c7a950fbdc3922b5dc Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 28 May 2022 18:37:40 -0700 Subject: fix(cgit): define the list of repos prior to scan path From the documentation for `project-list`: A list of subdirectories inside of scan-path, relative to it, that should loaded as git repositories. This must be defined prior to scan-path Change-Id: Iab176a800e8ff0abd515a525d89ef524ba6ab097 Reviewed-on: https://cl.fcuny.net/c/world/+/122 Reviewed-by: Franck Cuny --- modules/services/cgit/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/services/cgit/default.nix b/modules/services/cgit/default.nix index 0ac6a58..a310e14 100644 --- a/modules/services/cgit/default.nix +++ b/modules/services/cgit/default.nix @@ -28,8 +28,8 @@ let # don't index or follow robots="noindex, nofollow" - scan-path=/var/lib/gerrit/git project-list=/var/lib/cgit/cache/projects.list + scan-path=/var/lib/gerrit/git ''; in { options.my.services.cgit = with lib; { @@ -59,7 +59,7 @@ in { # as per https://gerrit-review.googlesource.com/Documentation/rest-api.html#output we need to remove `)]}' from the response repos=$(${pkgs.curl}/bin/curl -s -H "Content-Type: application/json" "https://cl.fcuny.net/projects/?state=ACTIVE"|sed "s/^)]}'//"|${pkgs.jq}/bin/jq -r 'to_entries | .[] | .value | .id') for repo in ''${repos}; do - echo "/var/lib/gerrit/git/''${repo}.git" >> $tmplist + echo "''${repo}.git" >> $tmplist done mv $tmplist /var/lib/cgit/cache/projects.list ''; -- cgit 1.4.1