Merge pull request #38527 from gnidorah/gitweb

nixos/nginx: fix gitweb submodule
This commit is contained in:
Wout Mertens 2018-04-07 14:39:51 +02:00 committed by GitHub
commit d55e830982
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 17 deletions

View file

@ -28,6 +28,7 @@ in
example = ''
$feature{'highlight'}{'default'} = [1];
$feature{'ctags'}{'default'} = [1];
$feature{'avatar'}{'default'} = ['gravatar'];
'';
};

View file

@ -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;
'';
};
};