From 093e821d1c5fa2eaca7c932ad9cb060ebce24b62 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Mon, 9 Feb 2026 00:36:11 +0100 Subject: [PATCH] uwsgi: move env variable(s) into env for structuredAttrs --- pkgs/by-name/uw/uwsgi/package.nix | 33 ++++++++++++++++--------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/uw/uwsgi/package.nix b/pkgs/by-name/uw/uwsgi/package.nix index 9af8e230f42b..0da10531d2ff 100644 --- a/pkgs/by-name/uw/uwsgi/package.nix +++ b/pkgs/by-name/uw/uwsgi/package.nix @@ -126,11 +126,23 @@ stdenv.mkDerivation (finalAttrs: { lib.optional withPAM "pam" ++ lib.optional withSystemd "systemd_logger" ); - # UWSGI_INCLUDES environment variable required for "auto" plugins - # to be detected. See uwsgiconfig.py for more details. - UWSGI_INCLUDES = lib.concatStringsSep "," ( - map (p: "${lib.getDev p}/include") finalAttrs.buildInputs - ); + env = { + # UWSGI_INCLUDES environment variable required for "auto" plugins + # to be detected. See uwsgiconfig.py for more details. + UWSGI_INCLUDES = lib.concatStringsSep "," ( + map (p: "${lib.getDev p}/include") finalAttrs.buildInputs + ); + } + // lib.optionalAttrs (lib.any (x: x.name == "php") needed) { + # this is a hack to make the php plugin link with session.so (which on nixos is a separate package) + # the hack works in coordination with ./additional-php-ldflags.patch + UWSGICONFIG_PHP_LDFLAGS = lib.concatStringsSep "," [ + "-Wl" + "-rpath=${php-embed.extensions.session}/lib/php/extensions/" + "--library-path=${php-embed.extensions.session}/lib/php/extensions/" + "-l:session.so" + ]; + }; passthru = { inherit python3; @@ -154,17 +166,6 @@ stdenv.mkDerivation (finalAttrs: { runHook postConfigure ''; - # this is a hack to make the php plugin link with session.so (which on nixos is a separate package) - # the hack works in coordination with ./additional-php-ldflags.patch - UWSGICONFIG_PHP_LDFLAGS = lib.optionalString (lib.any (x: x.name == "php") needed) ( - lib.concatStringsSep "," [ - "-Wl" - "-rpath=${php-embed.extensions.session}/lib/php/extensions/" - "--library-path=${php-embed.extensions.session}/lib/php/extensions/" - "-l:session.so" - ] - ); - buildPhase = '' runHook preBuild