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-14 08:44:41 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-14 08:44:41 +0200
commit59679318a30dd78c75ca52b047ee697a2985f196 (patch)
tree8a08dfd05ae502616a8461e8121a59d507aec90f /modules/nixos/vhack
parentbuild(flake.nix): Remove `ragenix` from the devshell (diff)
downloadnixos-server-59679318a30dd78c75ca52b047ee697a2985f196.tar.gz
nixos-server-59679318a30dd78c75ca52b047ee697a2985f196.zip
fix(nixos/git-server): Use the correct number in the `section-from-path` setting
Take for example a repository name like: `some/organisation/project_a/team_c/repo_b`.
Setting the setting to `-1` means that cgit traverses the path from left
to right, until it has found 1 element (and `section-from-path` (or n
for short)is 0, because n is incremented after each iteration). E.g. :
                                                                    ~ [n=-1]
starting point:            `some/organisation/project_a/team_c/repo_b`
                                                              ~ [n=0]
after the first iteration: `some/organisation/project_a/team_c/repo_b`

Now `some/organisation/project_a/team_c` becomes the section, whilst
`repo_b` becomes the repo name.
Diffstat (limited to 'modules/nixos/vhack')
-rw-r--r--modules/nixos/vhack/git-server/default.nix5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/nixos/vhack/git-server/default.nix b/modules/nixos/vhack/git-server/default.nix
index bf78f80..ed73cc7 100644
--- a/modules/nixos/vhack/git-server/default.nix
+++ b/modules/nixos/vhack/git-server/default.nix
@@ -161,9 +161,8 @@ in {
           css = "/custom_cgit.css";
 
           # This is a number of path elements to treat as section.
-          # Per default one, for the users. Orgs should use the `cgit.section` key to set
-          # a correct section name.
-          section-from-path = 1;
+          # `-1` means that we treat the last element as name, all others as sections
+          section-from-path = -1;
 
           project-list = "${config.services.gitolite.dataDir}/projects.list";