2021-11-22 21:39:44 +01:00
|
|
|
{ pkgs
|
|
|
|
, config # system configuration
|
|
|
|
, appConfig
|
2021-11-22 21:48:45 +01:00
|
|
|
, phpPackages
|
|
|
|
, phpExtensions
|
2021-11-22 21:39:44 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert appConfig.php.scriptMemoryLimitMb > appConfig.maxUploadMb;
|
|
|
|
|
|
|
|
''
|
|
|
|
memory_limit ${toString appConfig.php.scriptMemoryLimitMb}M
|
|
|
|
|
2021-11-22 21:48:45 +01:00
|
|
|
extension = "${phpExtensions.imagick}/lib/php/extensions/imagick.so"
|
2021-11-22 21:39:44 +01:00
|
|
|
|
|
|
|
${pkgs.lib.optionalString appConfig.opcache.enable ''
|
|
|
|
zend_extension = "${config.services.phpfpm.phpPackage}/lib/php/extensions/opcache.so"
|
|
|
|
''}
|
|
|
|
|
|
|
|
${pkgs.lib.optionalString appConfig.php.enableXDebug ''
|
|
|
|
; WARNING: Be sure to load opcache *before* xdebug (http://us3.php.net/manual/en/opcache.installation.php).
|
2021-11-22 21:48:45 +01:00
|
|
|
zend_extension = "${phpPackages.xdebug}/lib/php/extensions/xdebug.so"
|
2021-11-22 21:39:44 +01:00
|
|
|
''}
|
|
|
|
|
|
|
|
upload_max_filesize = ${toString appConfig.maxUploadMb}M
|
|
|
|
post_max_size = ${toString appConfig.maxUploadMb}M
|
|
|
|
max_execution_time ${toString appConfig.php.maxExecutionTimeSec}
|
|
|
|
|
|
|
|
date.timezone = "${appConfig.timezone}"
|
|
|
|
sendmail_path = ${appConfig.php.sendmailPath}
|
|
|
|
|
|
|
|
${import ./opcache-config.nix (appConfig.opcache // {
|
|
|
|
# Enable timestamp validation if the setup is not entirely frozen (managed by Nix).
|
|
|
|
validateTimestamps = ! builtins.all (x: x)
|
|
|
|
[appConfig.freezeWordPress appConfig.freezePlugins appConfig.freezeThemes];
|
|
|
|
})}
|
|
|
|
''
|