lol

nixos/lighttpd: add enableUpstreamMimeTypes option

enableUpstreamMimeTypes controls whether to include the list of mime
types bundled with lighttpd (upstream). This option is enabled by
default and gives a much more complete mime type list than we currently
have. If you disable this, no mime types will be added by NixOS and you
will have to add your own mime types in services.lighttpd.extraConfig.

+14 -8
+14 -8
nixos/modules/services/web-servers/lighttpd/default.nix
··· 89 accesslog.use-syslog = "enable" 90 server.errorlog-use-syslog = "enable" 91 92 - mimetype.assign = ( 93 - ".html" => "text/html", 94 - ".htm" => "text/html", 95 - ".txt" => "text/plain", 96 - ".jpg" => "image/jpeg", 97 - ".png" => "image/png", 98 - ".css" => "text/css" 99 - ) 100 101 static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" ) 102 index-file.names = ( "index.html" ) ··· 165 want to add custom stuff to 166 <option>services.lighttpd.extraConfig</option> that depends on a 167 certain module. 168 ''; 169 }; 170
··· 89 accesslog.use-syslog = "enable" 90 server.errorlog-use-syslog = "enable" 91 92 + ${lib.optionalString cfg.enableUpstreamMimeTypes '' 93 + include "${pkgs.lighttpd}/share/lighttpd/doc/config/conf.d/mime.conf" 94 + ''} 95 96 static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" ) 97 index-file.names = ( "index.html" ) ··· 160 want to add custom stuff to 161 <option>services.lighttpd.extraConfig</option> that depends on a 162 certain module. 163 + ''; 164 + }; 165 + 166 + enableUpstreamMimeTypes = mkOption { 167 + type = types.bool; 168 + default = true; 169 + description = '' 170 + Whether to include the list of mime types bundled with lighttpd 171 + (upstream). If you disable this, no mime types will be added by 172 + NixOS and you will have to add your own mime types in 173 + <option>services.lighttpd.extraConfig</option>. 174 ''; 175 }; 176