1 { config, lib, pkgs, ... }:
6 cfg = config.services.gitweb;
7 package = pkgs.gitweb.override (optionalAttrs cfg.gitwebTheme {
14 options.services.lighttpd.gitweb = {
19 description = lib.mdDoc ''
20 If true, enable gitweb in lighttpd. Access it at http://yourserver/gitweb
26 config = mkIf config.services.lighttpd.gitweb.enable {
28 # declare module dependencies
29 services.lighttpd.enableModules = [ "mod_cgi" "mod_redirect" "mod_alias" "mod_setenv" ];
31 services.lighttpd.extraConfig = ''
32 $HTTP["url"] =~ "^/gitweb" {
34 ".cgi" => "${pkgs.perl}/bin/perl"
37 "^/gitweb$" => "/gitweb/"
40 "/gitweb/static/" => "${package}/static/",
41 "/gitweb/" => "${package}/gitweb.cgi"
43 setenv.add-environment = (
44 "GITWEB_CONFIG" => "${cfg.gitwebConfigFile}",
45 "HOME" => "${cfg.projectroot}"