From 64973309bba193864683109d56bb7d64987b57e1 Mon Sep 17 00:00:00 2001 From: superherointj <5861043+superherointj@users.noreply.github.com> Date: Wed, 22 May 2024 21:39:31 -0300 Subject: [PATCH 1/3] 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 --- pkgs/servers/http/nginx/generic.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/http/nginx/generic.nix b/pkgs/servers/http/nginx/generic.nix index 67e84f08448e..11171a331ba9 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" From e3e087e9ead7aa8892f38a5fa7443cbc9a0f5cbd Mon Sep 17 00:00:00 2001 From: superherointj <5861043+superherointj@users.noreply.github.com> Date: Thu, 23 May 2024 07:35:40 -0300 Subject: [PATCH 2/3] nginx: make geoip optional --- pkgs/servers/http/nginx/generic.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/http/nginx/generic.nix b/pkgs/servers/http/nginx/generic.nix index 11171a331ba9..bc97c4972be7 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 +, withGeoIP ? false , withImageFilter ? false , withKTLS ? true , withStream ? true @@ -65,9 +66,10 @@ stdenv.mkDerivation { removeReferencesTo ] ++ nativeBuildInputs; - buildInputs = [ openssl zlib pcre libxml2 libxslt geoip perl ] + buildInputs = [ openssl zlib pcre libxml2 libxslt perl ] ++ buildInputs ++ mapModules "inputs" + ++ lib.optional withGeoIP geoip ++ lib.optional withImageFilter gd; configureFlags = [ @@ -116,8 +118,7 @@ stdenv.mkDerivation { "--with-perl_modules_path=lib/perl5" ] ++ 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.optionals withGeoIP ([ "--with-http_geoip_module" ] ++ lib.optional withStream "--with-stream_geoip_module") ++ lib.optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio" ++ configureFlags ++ map (mod: "--add-module=${mod.src}") modules; From f2a202ff38bdca293e8b96de05e983f1f603365a Mon Sep 17 00:00:00 2001 From: superherointj <5861043+superherointj@users.noreply.github.com> Date: Sat, 25 May 2024 12:12:50 -0300 Subject: [PATCH 3/3] nixos/doc/rl-2411: nginx now has gd, geoip as an optional --- nixos/doc/manual/release-notes/rl-2411.section.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index 343c1fc5933d..2338cf6e6fee 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -12,6 +12,8 @@ ## Backward Incompatibilities {#sec-release-24.11-incompatibilities} +- `nginx` package no longer includes `gd` and `geoip` dependencies. For enabling it, override `nginx` package with the optionals `withImageFilter` and `withGeoIP`. + - `nvimpager` was updated to version 0.13.0, which changes the order of user and nvimpager settings: user commands in `-c` and `--cmd` now override the respective default settings because they are executed later.