1
0
Fork 0
This commit is contained in:
Lukas Wurzinger 2025-04-13 17:13:51 +02:00
commit 300f0c30ee
No known key found for this signature in database
6 changed files with 295 additions and 0 deletions

View 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
];
}

View 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)}
'';
}