diff options
Diffstat (limited to '')
-rw-r--r-- | modules/services/cgit/default.nix | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/services/cgit/default.nix b/modules/services/cgit/default.nix index 1c07049..9d7cb9a 100644 --- a/modules/services/cgit/default.nix +++ b/modules/services/cgit/default.nix @@ -56,10 +56,17 @@ in { script = '' mkdir -p /var/lib/cgit/cache tmplist=$(mktemp) + # 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') + + # list of repositories that I still want to be active in gerrit but I don't want to list here + exclude_repos="password-store|All-Projects|All-Users|homelab" + for repo in ''${repos}; do - echo "''${repo}.git" >> $tmplist + if [[ ! $exclude_repos ~= $repo ]]; then + echo "''${repo}.git" >> $tmplist + fi done mv $tmplist /var/lib/cgit/cache/projects.list # TODO(fcuny): this should run as the git user |