@@ -3,13 +3,7 @@
33with lib;
44
55let
6− cfg = config.services.nginx.gitweb;
7− gitwebConfigFile = pkgs.writeText "gitweb.conf" ''
8− # path to git projects (<project>.git)
9− $projectroot = "${cfg.projectroot}";
10− $highlight_bin = "${pkgs.highlight}/bin/highlight";
11− ${cfg.extraConfig}
12− '';
6+ cfg = config.services.gitweb;
137 gitwebPerlLibs = with pkgs.perlPackages; [ CGIFast FCGI FCGIProcManager HTMLTagCloud ];
148 git = pkgs.git.overrideAttrs (oldAttrs: rec {
159 postInstall = ''
@@ -34,30 +28,9 @@ in
3428 '';
3529 };
3630
37− projectroot = mkOption {
38− default = "/srv/git";
39− type = types.path;
40− description = ''
41− Path to git projects (bare repositories) that should be served by
42− gitweb. Must not end with a slash.
43− '';
44− };
45−
46− extraConfig = mkOption {
47− default = "";
48− type = types.lines;
49− description = ''
50− Verbatim configuration text appended to the generated gitweb.conf file.
51− '';
52− example = ''
53− $feature{'highlight'}{'default'} = [1];
54− $feature{'ctags'}{'default'} = [1];
55− '';
56− };
57−
5831 };
5932
60− config = mkIf cfg.enable {
33+ config = mkIf config.services.nginx.gitweb.enable {
6134
6235 systemd.sockets.gitweb = {
6336 description = "GitWeb Listen Socket";
@@ -87,7 +60,7 @@ in
8760 root = "${pkgs.git}/share/gitweb";
8861 extraConfig = ''
8962 include ${pkgs.nginx}/conf/fastcgi_params;
90− fastcgi_param GITWEB_CONFIG ${gitwebConfigFile};
63+ fastcgi_param GITWEB_CONFIG ${cfg.gitwebConfigFile};
9164 fastcgi_pass unix:/run/gitweb.sock;
9265 '';
9366 };