From aff0725a7d5171a99ff3baafc04b7cb2aa3722f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 15 Jul 2017 14:08:13 +0200 Subject: [PATCH] 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. --- .../services/web-servers/lighttpd/default.nix | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/web-servers/lighttpd/default.nix b/nixos/modules/services/web-servers/lighttpd/default.nix index 151b5ee1520..45a65965112 100644 --- a/nixos/modules/services/web-servers/lighttpd/default.nix +++ b/nixos/modules/services/web-servers/lighttpd/default.nix @@ -89,14 +89,9 @@ let accesslog.use-syslog = "enable" server.errorlog-use-syslog = "enable" - mimetype.assign = ( - ".html" => "text/html", - ".htm" => "text/html", - ".txt" => "text/plain", - ".jpg" => "image/jpeg", - ".png" => "image/png", - ".css" => "text/css" - ) + ${lib.optionalString cfg.enableUpstreamMimeTypes '' + include "${pkgs.lighttpd}/share/lighttpd/doc/config/conf.d/mime.conf" + ''} static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" ) index-file.names = ( "index.html" ) @@ -168,6 +163,17 @@ in ''; }; + enableUpstreamMimeTypes = mkOption { + type = types.bool; + default = true; + description = '' + Whether to include the list of mime types bundled with lighttpd + (upstream). If you disable this, no mime types will be added by + NixOS and you will have to add your own mime types in + . + ''; + }; + mod_status = mkOption { default = false; type = types.bool;