11 cfg = config.services.nginx.gitweb;
12 gitwebConfig = config.services.gitweb;
13 package = pkgs.gitweb.override (
14 optionalAttrs gitwebConfig.gitwebTheme {
22 options.services.nginx.gitweb = {
28 If true, enable gitweb in nginx.
36 Location to serve gitweb on.
44 Existing user that the CGI process will belong to. (Default almost surely will do.)
52 Group that the CGI process will belong to. (Set to `config.services.gitolite.group` if you are using gitolite.)
56 virtualHost = mkOption {
60 VirtualHost to serve gitweb on. Default is catch-all.
66 config = mkIf cfg.enable {
68 systemd.services.gitweb = {
69 description = "GitWeb service";
70 script = "${package}/gitweb.cgi --fastcgi --nproc=1";
72 FCGI_SOCKET_PATH = "/run/gitweb/gitweb.sock";
77 RuntimeDirectory = [ "gitweb" ];
79 wantedBy = [ "multi-user.target" ];
83 virtualHosts.${cfg.virtualHost} = {
84 locations."${cfg.location}/static/" = {
85 alias = "${package}/static/";
87 locations."${cfg.location}/" = {
89 include ${config.services.nginx.package}/conf/fastcgi_params;
90 fastcgi_param GITWEB_CONFIG ${gitwebConfig.gitwebConfigFile};
91 fastcgi_pass unix:/run/gitweb/gitweb.sock;
99 meta.maintainers = [ ];