commit 3893d28f3e9883c5cd20ae54dbf4026c1cb78a33 parent eb931fbd708935e236ee10576f042876b3084ef9 Author: Francesco Saccone <francesco@francescosaccone.com> Date: Thu, 27 Mar 2025 18:31:01 +0100 fix: chown stagit destDir to 'git' after web server preStart script Signed-off-by: Francesco Saccone <francesco@francescosaccone.com> Diffstat:
M | hosts/git-server/default.nix | | | 25 | +++++++++++++++++++------ |
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/hosts/git-server/default.nix b/hosts/git-server/default.nix @@ -31,12 +31,25 @@ in darkhttpd = { enable = true; preStart = { - scripts = [ - (scripts.stagitCreate { - inherit (stagit) destDir reposDir; - httpBaseUrl = "https://${gitDomain}"; - }) - ]; + scripts = + let + stagitCreate = scripts.stagitCreate { + inherit (stagit) destDir reposDir; + httpBaseUrl = "https://${gitDomain}"; + }; + + stagitCreateAndChown = + let + script = pkgs.writeShellScriptBin "stagit-create-and-chown" '' + ${stagitCreate} + ${pkgs.sbase}/bin/chown -R git:git ${stagit.destDir} + ''; + in + "${script}/bin/stagit-create-and-chown"; + in + [ + stagitCreateAndChown + ]; }; symlinks = {