1 { config, lib, pkgs, ... }:
6 cfg = config.services.nginx.gitweb;
7 gitwebConfig = config.services.gitweb;
8 package = pkgs.gitweb.override (optionalAttrs gitwebConfig.gitwebTheme {
15 options.services.nginx.gitweb = {
21 If true, enable gitweb in nginx.
29 Location to serve gitweb on.
37 Existing user that the CGI process will belong to. (Default almost surely will do.)
45 Group that the CGI process will belong to. (Set to `config.services.gitolite.group` if you are using gitolite.)
49 virtualHost = mkOption {
53 VirtualHost to serve gitweb on. Default is catch-all.
59 config = mkIf cfg.enable {
61 systemd.services.gitweb = {
62 description = "GitWeb service";
63 script = "${package}/gitweb.cgi --fastcgi --nproc=1";
65 FCGI_SOCKET_PATH = "/run/gitweb/gitweb.sock";
70 RuntimeDirectory = [ "gitweb" ];
72 wantedBy = [ "multi-user.target" ];
76 virtualHosts.${cfg.virtualHost} = {
77 locations."${cfg.location}/static/" = {
78 alias = "${package}/static/";
80 locations."${cfg.location}/" = {
82 include ${config.services.nginx.package}/conf/fastcgi_params;
83 fastcgi_param GITWEB_CONFIG ${gitwebConfig.gitwebConfigFile};
84 fastcgi_pass unix:/run/gitweb/gitweb.sock;
92 meta.maintainers = [ ];