File tree 1 file changed +52
-1
lines changed
1 file changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ Import the input:
126
126
127
127
``` nix
128
128
inputs = {
129
- nixpkgs.url = "github:NixOS/nixpkgs/nixos -unstable";
129
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs -unstable";
130
130
flake-utils.url = "github:numtide/flake-utils";
131
131
phps.url = "github:loophp/nix-shell";
132
132
};
146
146
phps.packages.${system}.env-php81-nts
147
147
```
148
148
149
+ You may also use the API to build your own custom version of PHP in your own
150
+ flake:
151
+
152
+ ``` nix
153
+ {
154
+ description = "A very basic flake";
155
+
156
+ inputs = {
157
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
158
+ flake-utils.url = "github:numtide/flake-utils";
159
+ nix-shell.url = "github:loophp/nix-shell";
160
+ };
161
+
162
+ outputs = { self, nixpkgs, flake-utils, nix-shell }:
163
+ flake-utils.lib.eachDefaultSystem
164
+ (system:
165
+ let
166
+ pkgs = import nixpkgs {
167
+ inherit system;
168
+ };
169
+
170
+ php = (nix-shell.api.makePhp system {
171
+ php = "php81";
172
+ extensions = [ "pcov" "xdebug" ];
173
+ withoutExtensions = [ "sodium" ];
174
+ extraConfig = ''
175
+ memory_limit=-1
176
+ '';
177
+ flags = {
178
+ apxs2Support = false;
179
+ ztsSupport = false;
180
+ };
181
+ });
182
+ in
183
+ {
184
+ devShells = {
185
+ default = pkgs.mkShellNoCC {
186
+ name = "PHP project";
187
+
188
+ buildInputs = [
189
+ php
190
+ php.packages.composer
191
+ pkgs.mailhog
192
+ ];
193
+ };
194
+ };
195
+ }
196
+ );
197
+ }
198
+ ```
199
+
149
200
### Customize PHP
150
201
151
202
To customize the PHP configuration, you can do it like this:
You can’t perform that action at this time.
0 commit comments