nur/modules/web-apps/wordpress/php-config.nix

37 lines
1.2 KiB
Nix
Raw Normal View History

{ pkgs
, config # system configuration
, appConfig
2021-11-22 21:48:45 +01:00
, phpPackages
, phpExtensions
}:
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"
${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"
''}
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];
})}
''