nginx: Allow GD to be optional.

This commit permits incantations like `pkgs.nginx.override { gd = null; }` to
produce a slimmed-down nginx.

When used, this functionality removes a pile of stuff from nginx's closure.
The resulting nginx's closure:

    $ nix-store -q -R /nix/store/wk3h0a4dmdmjmxkbd0q09iw0wfq0yzpz-nginx-1.10.2 | wc -l
    12
    $ nix-store -q -R /nix/store/gpcx77anqrj05qz0mrwm7hf4wgxry5py-nginx-1.10.2 | wc -l
    24
This commit is contained in:
Corbin 2016-12-25 23:17:11 -08:00
parent da70d3da0f
commit ca2fa4416e

View File

@ -27,7 +27,6 @@ stdenv.mkDerivation {
"--with-http_realip_module"
"--with-http_addition_module"
"--with-http_xslt_module"
"--with-http_image_filter_module"
"--with-http_geoip_module"
"--with-http_sub_module"
"--with-http_dav_module"
@ -44,6 +43,7 @@ stdenv.mkDerivation {
# Install destination problems
# "--with-http_perl_module"
] ++ optional withStream "--with-stream"
++ optional (gd != null) "--with-http_image_filter_module"
++ optional (elem stdenv.system (with platforms; linux ++ freebsd)) "--with-file-aio"
++ map (mod: "--add-module=${mod.src}") modules;