summary refs log tree commit diff
path: root/nixos/modules/services/web-servers/phpfpm/default.nix
diff options
context:
space:
mode:
authorFabian Schmitthenner <github.fabian@schmitthenner.eu>2017-02-26 13:29:46 +0100
committerRobin Gloster <mail@glob.in>2017-02-26 23:35:12 +0100
commitae67f060f28028c31b091460167bb598bd8d3e6d (patch)
tree7640976afd837d6199d0c14a1a726487ecfd7948 /nixos/modules/services/web-servers/phpfpm/default.nix
parent78d9414ce534e570853fa3b7920c0906db9f169b (diff)
downloadnixpkgs-ae67f060f28028c31b091460167bb598bd8d3e6d.tar
nixpkgs-ae67f060f28028c31b091460167bb598bd8d3e6d.tar.gz
nixpkgs-ae67f060f28028c31b091460167bb598bd8d3e6d.tar.bz2
nixpkgs-ae67f060f28028c31b091460167bb598bd8d3e6d.tar.lz
nixpkgs-ae67f060f28028c31b091460167bb598bd8d3e6d.tar.xz
nixpkgs-ae67f060f28028c31b091460167bb598bd8d3e6d.tar.zst
nixpkgs-ae67f060f28028c31b091460167bb598bd8d3e6d.zip
phpfpm: eliminate build at evaluation time
phpfpm currently uses `readFile` to read the php.ini file from the
phpPackage. This causes php to be build at evaluation time.

This eliminates the use of readFile and builds the php.ini at build
time.
Diffstat (limited to 'nixos/modules/services/web-servers/phpfpm/default.nix')
-rw-r--r--nixos/modules/services/web-servers/phpfpm/default.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/nixos/modules/services/web-servers/phpfpm/default.nix b/nixos/modules/services/web-servers/phpfpm/default.nix
index ed537e7122a..2471a06a3b0 100644
--- a/nixos/modules/services/web-servers/phpfpm/default.nix
+++ b/nixos/modules/services/web-servers/phpfpm/default.nix
@@ -24,10 +24,11 @@ let
     ${concatStringsSep "\n" (mapAttrsToList (n: v: "[${n}]\n${v}") cfg.poolConfigs)}
   '';
 
-  phpIni = pkgs.writeText "php.ini" ''
-    ${readFile "${cfg.phpPackage}/etc/php.ini"}
-
-    ${cfg.phpOptions}
+  phpIni = pkgs.runCommand "php.ini" {
+    inherit (cfg) phpPackage phpOptions;
+    passAsFile = [ "phpOptions" ];
+  } ''
+    cat $phpPackage/etc/php.ini $phpOptionsFile > $out
   '';
 
 in {