summary refs log tree commit diff stats
path: root/modules/nixos/vhack
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-13 22:31:59 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-13 22:40:45 +0200
commit4337bf29dc05a5bae3b628acb38643a2ce5419e4 (patch)
tree969fa29e6a03958d09cbe1f1d95a76ebc566f0c9 /modules/nixos/vhack
parentfix(nixos/git-server): Correctly enable the git config feature of gitolite (diff)
downloadnixos-server-4337bf29dc05a5bae3b628acb38643a2ce5419e4.tar.gz
nixos-server-4337bf29dc05a5bae3b628acb38643a2ce5419e4.zip
fix(nixos/git-server): Correctly specify the section from path length
Cgit effectively splits the repo path on '/' and then takes
`section-from-path` segments, which form the section. A negative value
here results in cgit traversing the path from left to right instead of
right to left. Beware that cgit only sets the section, if the path
contains `section-from-path` or more slashes in it (thus rendering this
setting defunct with the previous value of 1000).

There seems to be no way to tell cgit to always use all components up-to
the second to last for the section name, thus requiring all projects
that need a longer than 1 section length to set the `cgit.section`
git config variable via gitolite.
Diffstat (limited to 'modules/nixos/vhack')
-rw-r--r--modules/nixos/vhack/git-server/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/nixos/vhack/git-server/default.nix b/modules/nixos/vhack/git-server/default.nix
index 83e18f8..bf78f80 100644
--- a/modules/nixos/vhack/git-server/default.nix
+++ b/modules/nixos/vhack/git-server/default.nix
@@ -161,8 +161,9 @@ in {
           css = "/custom_cgit.css";
 
           # This is a number of path elements to treat as section.
-          # Set this to a big number to ensure all path elements are treated as sections.
-          section-from-path = 1000;
+          # Per default one, for the users. Orgs should use the `cgit.section` key to set
+          # a correct section name.
+          section-from-path = 1;
 
           project-list = "${config.services.gitolite.dataDir}/projects.list";