Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 30, 2022
1 parent 82c900d commit f224ad4
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Import the input:

```nix
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
phps.url = "github:loophp/nix-shell";
};
Expand All @@ -146,6 +146,57 @@ or
phps.packages.${system}.env-php81-nts
```

You may also use the API to build your own custom version of PHP in your own
flake:

```nix
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
nix-shell.url = "github:loophp/nix-shell";
};
outputs = { self, nixpkgs, flake-utils, nix-shell }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
};
php = (nix-shell.api.makePhp system {
php = "php81";
extensions = [ "pcov" "xdebug" ];
withoutExtensions = [ "sodium" ];
extraConfig = ''
memory_limit=-1
'';
flags = {
apxs2Support = false;
ztsSupport = false;
};
});
in
{
devShells = {
default = pkgs.mkShellNoCC {
name = "PHP project";
buildInputs = [
php
php.packages.composer
pkgs.mailhog
];
};
};
}
);
}
```

### Customize PHP

To customize the PHP configuration, you can do it like this:
Expand Down

0 comments on commit f224ad4

Please sign in to comment.