summary refs log tree commit diff stats
path: root/modules/nixos/vhack
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/nixos/vhack/git-server.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/nixos/vhack/git-server.nix b/modules/nixos/vhack/git-server.nix
index bcc049a..9e21b5c 100644
--- a/modules/nixos/vhack/git-server.nix
+++ b/modules/nixos/vhack/git-server.nix
@@ -34,6 +34,14 @@ in {
       nginx.virtualHosts."git.vhack.eu" = {
         enableACME = true;
         forceSSL = true;
+        locations."~ \"^/[0-9A-Za-z._-]+/(HEAD|info/refs|objects/info/(alternates|http-alternates|packs)|[0-9a-f]{2}/([0-9a-f]{38}|[0-9a-f]{62})|pack/pack-([0-9a-f]{40}|[0-9a-f]{64})\\.(pack|idx)|git-upload-pack|git-receive-pack)$\"".extraConfig = ''
+          include ${pkgs.nginx}/conf/fastcgi_params;
+          fastcgi_param GIT_HTTP_EXPORT_ALL "";
+          fastcgi_param GIT_PROJECT_ROOT ${cfg.dataDir};
+          fastcgi_param PATH_INFO $fastcgi_script_name;
+          fastcgi_param SCRIPT_FILENAME ${pkgs.git}/bin/git-http-backend;
+          fastcgi_pass unix:${config.services.fcgiwrap.socketAddress};
+        '';
       };
     };
   };