Merge pull request #107044 from jtojnar/overridable-php-packages

This commit is contained in:
Jan Tojnar
2020-12-22 22:39:29 +01:00
committed by GitHub
3 changed files with 28 additions and 13 deletions
+18
View File
@@ -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 [] ++ [
];
});
};
};
}
```