init
This commit is contained in:
commit
300f0c30ee
6 changed files with 295 additions and 0 deletions
37
packages/myphp/package.nix
Normal file
37
packages/myphp/package.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
lib,
|
||||
php,
|
||||
symlinkJoin,
|
||||
}: let
|
||||
extraConfig = ''
|
||||
memory_limit = -1
|
||||
|
||||
xdebug.mode = develop,coverage,gcstats,profile,debug,trace
|
||||
xdebug.discover_client_host = 1
|
||||
xdebug.client_host = localhost
|
||||
'';
|
||||
|
||||
# Build PHP environment with required extensions
|
||||
phpEnv = php.buildEnv {
|
||||
extensions = {
|
||||
enabled,
|
||||
all,
|
||||
}:
|
||||
enabled
|
||||
++ [all.xdebug]
|
||||
++ (
|
||||
if (lib.versionAtLeast php.version "8")
|
||||
then [all.amqp]
|
||||
else []
|
||||
);
|
||||
inherit extraConfig;
|
||||
};
|
||||
in
|
||||
# Bundle composer alongside this PHP package
|
||||
symlinkJoin {
|
||||
inherit (phpEnv) name version meta passthru;
|
||||
paths = [
|
||||
phpEnv
|
||||
phpEnv.packages.composer
|
||||
];
|
||||
}
|
22
packages/symfony-cli/package.nix
Normal file
22
packages/symfony-cli/package.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
lib,
|
||||
phps,
|
||||
symlinkJoin,
|
||||
symfony-cli,
|
||||
makeWrapper,
|
||||
}: let
|
||||
package = symfony-cli;
|
||||
in
|
||||
# Tell Symfony's CLI where it can access the different PHP versions
|
||||
symlinkJoin {
|
||||
inherit (package) pname version meta;
|
||||
|
||||
paths = [package];
|
||||
|
||||
buildInputs = [makeWrapper];
|
||||
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/${package.meta.mainProgram} \
|
||||
--suffix PATH : ${lib.makeBinPath (builtins.attrValues phps)}
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue