diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2020-12-16 00:06:42 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2020-12-16 18:32:27 +0100 |
commit | b2594c71c248b78b8526a62f43ad74151a31ac3a (patch) | |
tree | 46ba5291de16355c6a7ab4c411420405c8af5367 /doc | |
parent | 7e8b2b7e988cfd7e8e0745f0af3eb42b6a1918cb (diff) |
php.packages: Make packages overridable
This will allow patching extensions without having to manually having to patch all occurrences in the dependency tree.
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 [] ++ [ + … + ]; + }); + }; + }; +} +``` |