nixos/gitweb: add gitwebTheme option

This commit is contained in:
gnidorah
2018-04-17 20:07:01 +03:00
parent a415a95e7c
commit 9029ed933c
7 changed files with 65 additions and 19 deletions
@@ -4,6 +4,9 @@ with lib;
let
cfg = config.services.gitweb;
package = pkgs.gitweb.override (optionalAttrs cfg.gitwebTheme {
gitwebTheme = true;
});
in
{
@@ -24,7 +27,7 @@ in
systemd.services.gitweb = {
description = "GitWeb service";
script = "${pkgs.git}/share/gitweb/gitweb.cgi --fastcgi --nproc=1";
script = "${package}/gitweb.cgi --fastcgi --nproc=1";
environment = {
FCGI_SOCKET_PATH = "/run/gitweb/gitweb.sock";
};
@@ -38,11 +41,10 @@ in
services.nginx = {
virtualHosts.default = {
locations."/gitweb/" = {
root = "${pkgs.git}/share";
tryFiles = "$uri @gitweb";
locations."/gitweb/static/" = {
alias = "${package}/static/";
};
locations."@gitweb" = {
locations."/gitweb/" = {
extraConfig = ''
include ${pkgs.nginx}/conf/fastcgi_params;
fastcgi_param GITWEB_CONFIG ${cfg.gitwebConfigFile};