summary refs log tree commit diff
diff options
context:
space:
mode:
authorgnidorah <gnidorah@users.noreply.github.com>2018-04-06 22:36:03 +0300
committergnidorah <gnidorah@users.noreply.github.com>2018-04-06 22:36:03 +0300
commit073089914e7890960ffa4cc5b57b18950d90ba37 (patch)
treee82b0ec81b09a96a8b2787d849ee446e34b36589
parent97e891aee0df5b7edc705a40340be37f2d35bf9f (diff)
downloadnixpkgs-073089914e7890960ffa4cc5b57b18950d90ba37.tar
nixpkgs-073089914e7890960ffa4cc5b57b18950d90ba37.tar.gz
nixpkgs-073089914e7890960ffa4cc5b57b18950d90ba37.tar.bz2
nixpkgs-073089914e7890960ffa4cc5b57b18950d90ba37.tar.lz
nixpkgs-073089914e7890960ffa4cc5b57b18950d90ba37.tar.xz
nixpkgs-073089914e7890960ffa4cc5b57b18950d90ba37.tar.zst
nixpkgs-073089914e7890960ffa4cc5b57b18950d90ba37.zip
nixos/nginx: fix gitweb submodule
-rw-r--r--nixos/modules/services/misc/gitweb.nix1
-rw-r--r--nixos/modules/services/web-servers/nginx/gitweb.nix29
2 files changed, 13 insertions, 17 deletions
diff --git a/nixos/modules/services/misc/gitweb.nix b/nixos/modules/services/misc/gitweb.nix
index 8e4d85a1e15..b0e34a690ca 100644
--- a/nixos/modules/services/misc/gitweb.nix
+++ b/nixos/modules/services/misc/gitweb.nix
@@ -28,6 +28,7 @@ in
       example = ''
         $feature{'highlight'}{'default'} = [1];
         $feature{'ctags'}{'default'} = [1];
+        $feature{'avatar'}{'default'} = ['gravatar'];
       '';
     };
 
diff --git a/nixos/modules/services/web-servers/nginx/gitweb.nix b/nixos/modules/services/web-servers/nginx/gitweb.nix
index 344c1f7b8aa..3dc3ebc7e4c 100644
--- a/nixos/modules/services/web-servers/nginx/gitweb.nix
+++ b/nixos/modules/services/web-servers/nginx/gitweb.nix
@@ -22,36 +22,31 @@ in
 
   config = mkIf config.services.nginx.gitweb.enable {
 
-    systemd.sockets.gitweb = {
-      description = "GitWeb Listen Socket";
-      listenStreams = [ "/run/gitweb.sock" ];
-      socketConfig = {
-        Accept = "false";
-        SocketUser = "nginx";
-        SocketGroup = "nginx";
-        SocketMode = "0600";
-      };
-      wantedBy = [ "sockets.target" ];
-    };
     systemd.services.gitweb = {
       description = "GitWeb service";
-      script = "${git}/share/gitweb/gitweb.cgi --fcgi";
+      script = "${pkgs.git}/share/gitweb/gitweb.cgi --fastcgi --nproc=1";
+      environment  = {
+        FCGI_SOCKET_PATH = "/run/gitweb/gitweb.sock";
+      };
       serviceConfig = {
-        Type = "simple";
-        StandardInput = "socket";
         User = "nginx";
         Group = "nginx";
+        RuntimeDirectory = [ "gitweb" ];
       };
+      wantedBy = [ "multi-user.target" ];
     };
 
     services.nginx = {
       virtualHosts.default = {
-        locations."/gitweb" = {
-          root = "${pkgs.git}/share/gitweb";
+        locations."/gitweb/" = {
+          root = "${pkgs.git}/share";
+          tryFiles = "$uri @gitweb";
+        };
+        locations."@gitweb" = {
           extraConfig = ''
             include ${pkgs.nginx}/conf/fastcgi_params;
             fastcgi_param GITWEB_CONFIG ${cfg.gitwebConfigFile};
-            fastcgi_pass unix:/run/gitweb.sock;
+            fastcgi_pass unix:/run/gitweb/gitweb.sock;
           '';
         };
       };