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 89 accesslog.use-syslog = "enable" 90 90 server.errorlog-use-syslog = "enable" 91 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 - ) 92 + ${lib.optionalString cfg.enableUpstreamMimeTypes '' 93 + include "${pkgs.lighttpd}/share/lighttpd/doc/config/conf.d/mime.conf" 94 + ''} 100 95 101 96 static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" ) 102 97 index-file.names = ( "index.html" ) ··· 165 160 want to add custom stuff to 166 161 <option>services.lighttpd.extraConfig</option> that depends on a 167 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>. 168 174 ''; 169 175 }; 170 176