about summary refs log tree commit diff
path: root/pkgs/servers/http
diff options
context:
space:
mode:
authorsuperherointj <5861043+superherointj@users.noreply.github.com>2024-05-22 21:39:31 -0300
committersuperherointj <5861043+superherointj@users.noreply.github.com>2024-05-25 12:08:22 -0300
commit64973309bba193864683109d56bb7d64987b57e1 (patch)
tree997a48b4ebd8744aad5bd64db20188f66ff3eee4 /pkgs/servers/http
parent1a082d42b27d36c607033ec1b7904c28870bef48 (diff)
nginx: make image filter optional
Reduces nginx package size from 109.88 MiB to 41.99 MiB. Reduction of -67.88 MiB.

GD (libgd.github.io) is a library for the dynamic creation of images.

Co-authored-by: @ulrikstrid
Diffstat (limited to 'pkgs/servers/http')
-rw-r--r--pkgs/servers/http/nginx/generic.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkgs/servers/http/nginx/generic.nix b/pkgs/servers/http/nginx/generic.nix
index 67e84f08448e4..11171a331ba91 100644
--- a/pkgs/servers/http/nginx/generic.nix
+++ b/pkgs/servers/http/nginx/generic.nix
@@ -4,6 +4,7 @@ outer@{ lib, stdenv, fetchurl, fetchpatch, openssl, zlib, pcre, libxml2, libxslt
 , nixosTests
 , installShellFiles, substituteAll, removeReferencesTo, gd, geoip, perl
 , withDebug ? false
+, withImageFilter ? false
 , withKTLS ? true
 , withStream ? true
 , withMail ? false
@@ -64,9 +65,10 @@ stdenv.mkDerivation {
     removeReferencesTo
   ] ++ nativeBuildInputs;
 
-  buildInputs = [ openssl zlib pcre libxml2 libxslt gd geoip perl ]
+  buildInputs = [ openssl zlib pcre libxml2 libxslt geoip perl ]
     ++ buildInputs
-    ++ mapModules "inputs";
+    ++ mapModules "inputs"
+    ++ lib.optional withImageFilter gd;
 
   configureFlags = [
     "--sbin-path=bin/nginx"
@@ -112,8 +114,8 @@ stdenv.mkDerivation {
     "--with-http_perl_module"
     "--with-perl=${perl}/bin/perl"
     "--with-perl_modules_path=lib/perl5"
-  ] ++ lib.optional withSlice "--with-http_slice_module"
-    ++ lib.optional (gd != null) "--with-http_image_filter_module"
+  ] ++ lib.optional withImageFilter "--with-http_image_filter_module"
+    ++ lib.optional withSlice "--with-http_slice_module"
     ++ lib.optional (geoip != null) "--with-http_geoip_module"
     ++ lib.optional (withStream && geoip != null) "--with-stream_geoip_module"
     ++ lib.optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio"