I'm in the NixOS php maintainers team.
This is what you want in your configuration.nix
:
{ config, pkgs, lib, ... }:
let
custom-php = pkgs.php82.buildEnv {
extensions = ({ enabled, all }: enabled ++ (with all; [
xdebug
redis
]));
extraConfig = ''
memory_limit=2G
xdebug.mode=debug
'';
};
in
{
environment.systemPackages = [
custom-php
custom-php.packages.composer
];
}
Let me know how that works out for you.
aanderse
joined 1 year ago
Looks like you almost had it figured out.
composer
belongs to thephpPackages
set, an alias forphp.packages
, and any package under that set should use thephp
package you specify. This way you can customize thephp
configuration for various programs.I briefly looked at the documentation and I'm not sure that this is specifically mentioned. Unless I missed it this would be nice to add to our documentation.