summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorElis Hirwing <elis@hirwing.se>2020-04-02 22:13:04 +0200
committertalyz <kim.lindberger@gmail.com>2020-04-05 16:45:17 +0200
commita2099156eca905ee0b7a232cb7ec07539eebd72c (patch)
tree271a1dea88a60f49f88cac39a7307f6bf87540f9 /doc
parenta4bc30c802d99bcc5c2f4c7bb84d40da14137c4c (diff)
downloadnixpkgs-a2099156eca905ee0b7a232cb7ec07539eebd72c.tar
nixpkgs-a2099156eca905ee0b7a232cb7ec07539eebd72c.tar.gz
nixpkgs-a2099156eca905ee0b7a232cb7ec07539eebd72c.tar.bz2
nixpkgs-a2099156eca905ee0b7a232cb7ec07539eebd72c.tar.lz
nixpkgs-a2099156eca905ee0b7a232cb7ec07539eebd72c.tar.xz
nixpkgs-a2099156eca905ee0b7a232cb7ec07539eebd72c.tar.zst
nixpkgs-a2099156eca905ee0b7a232cb7ec07539eebd72c.zip
php: split php.packages to php.packages and php.extensions
So now we have only packages for human interaction in php.packages and
only extensions in php.extensions. With this php.packages.exts have
been merged into the same attribute set as all the other extensions to
make it flat and nice.

The nextcloud module have been updated to reflect this change as well
as the documentation.
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/php.section.md41
1 files changed, 15 insertions, 26 deletions
diff --git a/doc/languages-frameworks/php.section.md b/doc/languages-frameworks/php.section.md
index 9924946a45c..18d4ee83709 100644
--- a/doc/languages-frameworks/php.section.md
+++ b/doc/languages-frameworks/php.section.md
@@ -21,20 +21,12 @@ of a given NixOS release will be included in that release of
 NixOS. See [PHP Supported
 Versions](https://www.php.net/supported-versions.php).
 
-As for packages we have `php.packages` that contains a bunch of
-attributes where some are suitable as extensions (notable example:
-`php.packages.imagick`). And some are more suitable for command
-line use (notable example: `php.packages.composer`).
+For packages we have `php.packages` that contains packages related
+for human interaction, notable example is `php.packages.composer`.
 
-We have a special section within `php.packages` called
-`php.packages.exts` that contain certain PHP modules that may not
-be part of the default PHP derivation (example:
-`php.packages.exts.opcache`).
-
-The `php.packages.exts.*` attributes are official extensions which
-originate from the mainline PHP project, while other extensions within
-the `php.packages.*` attribute are of mixed origin (such as `pecl`
-and other places).
+For extensions we have `php.extensions` that contains most upstream
+extensions as separate attributes as well some additional extensions
+that tend to be popular, notable example is: `php.extensions.imagick`.
 
 The different versions of PHP that nixpkgs fetch is located under
 attributes named based on major and minor version number; e.g.,
@@ -43,23 +35,20 @@ attributes named based on major and minor version number; e.g.,
 
 #### Installing PHP with packages
 
-There's two different kinds of things you could install:
- - A command line utility. Simply refer to it via
-   `php*.packages.*`, and it automatically comes with the necessary
-   PHP environment, certain extensions and libraries around it.
- - A PHP interpreter with certain extensions available.  The `php`
-   attribute provides `php.buildEnv` that allows you to wrap the PHP
-   derivation with an additional config file that makes PHP import
-   additional libraries or dependencies.
+There's two majorly different parts of the PHP ecosystem in NixOS:
+ - Command line utilities for human interaction. These comes from the
+   `php.packages.*` attributes.
+ - PHP environments with different extensions enabled. These are
+   composed with `php.buildEnv` using an additional configuration file.
 
 ##### Example setup for `phpfpm`
 
-Example to build a PHP with `imagick` and `opcache` enabled, and
-configure it for the "foo" `phpfpm` pool:
+Example to build a PHP with the extensions `imagick` and `opcache`
+enabled. Then to configure it for the "foo" `phpfpm` pool:
 
 ```nix
 let
-  myPhp = php.buildEnv { exts = pp: with pp; [ imagick exts.opcache ]; };
+  myPhp = php.buildEnv { exts = pp: with pp; [ imagick opcache ]; };
 in {
   services.phpfpm.pools."foo".phpPackage = myPhp;
 };
@@ -68,8 +57,8 @@ in {
 ##### Example usage with `nix-shell`
 
 This brings up a temporary environment that contains a PHP interpreter
-with `imagick` and `opcache` enabled.
+with the extensions `imagick` and `opcache` enabled.
 
 ```sh
-nix-shell -p 'php.buildEnv { exts = pp: with pp; [ imagick exts.opcache ]; }'
+nix-shell -p 'php.buildEnv { exts = pp: with pp; [ imagick opcache ]; }'
 ```