gitweb: use common options
This commit is contained in:
@@ -3,13 +3,7 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.nginx.gitweb;
|
||||
gitwebConfigFile = pkgs.writeText "gitweb.conf" ''
|
||||
# path to git projects (<project>.git)
|
||||
$projectroot = "${cfg.projectroot}";
|
||||
$highlight_bin = "${pkgs.highlight}/bin/highlight";
|
||||
${cfg.extraConfig}
|
||||
'';
|
||||
cfg = config.services.gitweb;
|
||||
gitwebPerlLibs = with pkgs.perlPackages; [ CGIFast FCGI FCGIProcManager HTMLTagCloud ];
|
||||
git = pkgs.git.overrideAttrs (oldAttrs: rec {
|
||||
postInstall = ''
|
||||
@@ -34,30 +28,9 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
projectroot = mkOption {
|
||||
default = "/srv/git";
|
||||
type = types.path;
|
||||
description = ''
|
||||
Path to git projects (bare repositories) that should be served by
|
||||
gitweb. Must not end with a slash.
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
default = "";
|
||||
type = types.lines;
|
||||
description = ''
|
||||
Verbatim configuration text appended to the generated gitweb.conf file.
|
||||
'';
|
||||
example = ''
|
||||
$feature{'highlight'}{'default'} = [1];
|
||||
$feature{'ctags'}{'default'} = [1];
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = mkIf config.services.nginx.gitweb.enable {
|
||||
|
||||
systemd.sockets.gitweb = {
|
||||
description = "GitWeb Listen Socket";
|
||||
@@ -87,7 +60,7 @@ in
|
||||
root = "${pkgs.git}/share/gitweb";
|
||||
extraConfig = ''
|
||||
include ${pkgs.nginx}/conf/fastcgi_params;
|
||||
fastcgi_param GITWEB_CONFIG ${gitwebConfigFile};
|
||||
fastcgi_param GITWEB_CONFIG ${cfg.gitwebConfigFile};
|
||||
fastcgi_pass unix:/run/gitweb.sock;
|
||||
'';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user