From 82cd2fbbf470b0b53005737e8fd833a77cf2f38c Mon Sep 17 00:00:00 2001 From: Elis Hirwing Date: Sat, 28 Mar 2020 09:57:04 +0100 Subject: [PATCH] php: Wrap the programs and provide an environment variable instead of a flag --- pkgs/development/interpreters/php/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix index 082f2ef8fdcd..bfb024077c81 100644 --- a/pkgs/development/interpreters/php/default.nix +++ b/pkgs/development/interpreters/php/default.nix @@ -192,10 +192,13 @@ let }; paths = [ php ]; postBuild = '' - wrapProgram $out/bin/php \ - --add-flags "-c ${extraInit}" - wrapProgram $out/bin/php-fpm \ - --add-flags "-c ${extraInit}" + cp ${extraInit} $out/lib/custom-php.ini + + wrapProgram $out/bin/php --set PHP_INI_SCAN_DIR $out/lib + + if test -e $out/bin/php-fpm; then + wrapProgram $out/bin/php-fpm --set PHP_INI_SCAN_DIR $out/lib + fi ''; }; in