diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/php.section.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/languages-frameworks/php.section.md b/doc/languages-frameworks/php.section.md index 763beeb59358..5977363323f1 100644 --- a/doc/languages-frameworks/php.section.md +++ b/doc/languages-frameworks/php.section.md @@ -135,3 +135,21 @@ Example of building `composer` with additional extensions: enabled ++ (with all; [ imagick redis ])) ).packages.composer ``` + +### Overriding PHP packages {#ssec-php-user-guide-overriding-packages} + +`php-packages.nix` form a scope, allowing us to override the packages defined within. For example, to apply a patch to a `mysqlnd` extension, you can simply pass an overlay-style function to `php`’s `packageOverrides` argument: + +```nix +php.override { + packageOverrides = final: prev: { + extensions = prev.extensions // { + mysqlnd = prev.extensions.mysqlnd.overrideAttrs (attrs: { + patches = attrs.patches or [] ++ [ + … + ]; + }); + }; + }; +} +``` |