diff options
author | Franck Cuny <franck@fcuny.net> | 2022-05-28 18:37:40 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-05-28 18:39:12 -0700 |
commit | 9f9c7a108ddb4a2d071958c7a950fbdc3922b5dc (patch) | |
tree | 4021d4391c70ee09a9e99124875a9f8ee3ffb7e1 /modules/services/cgit | |
parent | fix(cgit): generate a proper list of repositories (diff) | |
download | world-9f9c7a108ddb4a2d071958c7a950fbdc3922b5dc.tar.gz |
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 <franck@fcuny.net>
Diffstat (limited to 'modules/services/cgit')
-rw-r--r-- | modules/services/cgit/default.nix | 4 |
1 files 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 ''; |