From 59679318a30dd78c75ca52b047ee697a2985f196 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 14 Aug 2024 08:44:41 +0200 Subject: 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. --- modules/nixos/vhack/git-server/default.nix | 5 ++--- 1 file 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"; -- cgit 1.4.1