• 0 Posts
  • 3 Comments
Joined 1 年前
cake
Cake day: 2023年9月2日

help-circle
  • aandersetoNixOS[Solved] Help with PHP and Composer
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 年前

    Looks like you almost had it figured out. composer belongs to the phpPackages set, an alias for php.packages, and any package under that set should use the php package you specify. This way you can customize the php configuration for various programs.

    And how could I find out something like this?

    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.



  • aandersetoNixOS[Solved] Help with PHP and Composer
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 年前

    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.