diff options
author | Elis Hirwing <elis@hirwing.se> | 2020-05-01 09:33:04 +0200 |
---|---|---|
committer | Elis Hirwing <elis@hirwing.se> | 2020-05-01 22:30:09 +0200 |
commit | e31a68ddba141e11f1569ae4d2cd0fb1a87fd5e4 (patch) | |
tree | 349373cc08aba035e89e631fc53a9aef9b272300 /doc/languages-frameworks | |
parent | d2cb49c248daad8decb0caa77a76aa09aec2d9de (diff) | |
download | nixpkgs-e31a68ddba141e11f1569ae4d2cd0fb1a87fd5e4.tar nixpkgs-e31a68ddba141e11f1569ae4d2cd0fb1a87fd5e4.tar.gz nixpkgs-e31a68ddba141e11f1569ae4d2cd0fb1a87fd5e4.tar.bz2 nixpkgs-e31a68ddba141e11f1569ae4d2cd0fb1a87fd5e4.tar.lz nixpkgs-e31a68ddba141e11f1569ae4d2cd0fb1a87fd5e4.tar.xz nixpkgs-e31a68ddba141e11f1569ae4d2cd0fb1a87fd5e4.tar.zst nixpkgs-e31a68ddba141e11f1569ae4d2cd0fb1a87fd5e4.zip |
doc/php: Add example for installing composer with extra extensions
Diffstat (limited to 'doc/languages-frameworks')
-rw-r--r-- | doc/languages-frameworks/php.section.md | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/doc/languages-frameworks/php.section.md b/doc/languages-frameworks/php.section.md index 30c05b3b614..763beeb5935 100644 --- a/doc/languages-frameworks/php.section.md +++ b/doc/languages-frameworks/php.section.md @@ -62,7 +62,7 @@ To build your list of extensions from the ground up, you can simply ignore `enabled`: ```nix -php.withExtensions ({ all, ... }: with all; [ opcache imagick ]) +php.withExtensions ({ all, ... }: with all; [ imagick opcache ]) ``` `php.withExtensions` provides extensions by wrapping a minimal php @@ -94,7 +94,7 @@ follows: ```nix let - myPhp = php.withExtensions ({ all, ... }: with all; [ opcache imagick ]); + myPhp = php.withExtensions ({ all, ... }: with all; [ imagick opcache ]); in { services.phpfpm.pools."foo".phpPackage = myPhp; }; @@ -119,3 +119,19 @@ with the extensions `imagick` and `opcache` enabled: ```sh nix-shell -p 'php.withExtensions ({ all, ... }: with all; [ imagick opcache ])' ``` + +### Installing PHP packages with extensions {#ssec-php-user-guide-installing-packages-with-extensions} + +All interactive tools use the PHP package you get them from, so all +packages at `php.packages.*` use the `php` package with its default +extensions. Sometimes this default set of extensions isn't enough and +you may want to extend it. A common case of this is the `composer` +package: a project may depend on certain extensions and `composer` +won't work with that project unless those extensions are loaded. + +Example of building `composer` with additional extensions: +```nix +(php.withExtensions ({ all, enabled }: + enabled ++ (with all; [ imagick redis ])) +).packages.composer +``` |