Home » Php » php – Nix Composable Derivation Options

php – Nix Composable Derivation Options

Posted by: admin April 23, 2020 Leave a comment

Questions:

I’m trying to understand what options are available for me in my configuration.nix for particular programs, by searching the pkgs sub-folder of nixpkgs’s source tree, picking out the module’s definitions to understand the available options. However, I’m running into a troublesome case for PHP – it’s a special derivation, a composable derivation. I’m not able to see what options I have available with PHP – something that would be tremendously helpful for enabling special modules like mcrypt, gd, etc. Any help with this would be greatly appreciated!

How to&Answers:

It took me a while to figure this out but the right way to use composeDerivation for setting the php package build features is this:

  # config.nix
  {
   packageOverrides = pkgs: rec {
      php = pkgs.php.merge {
        cfg = {
          imapSupport = false;
          intlSupport = false;
          fpmSupport = false;
        };
      };
   };
  }

This overrides the default values in cfg specified in php/default.nix (imapSupport, intlSupport and fpmSupport get turned off). You can either place that file in ~/.nixpkgs/config.nix to be active system-wide or use it in another nix file like so to customize the global nixpkgs:

pkgs = import <nixpkgs> { config = (import ./config.nix);  };

Answer:

Try tracking the file interactions from configuration.nix and also try to understand all those flags at first, the PHP file is an “startup engine” of some kind I doesn’t seem to have any possible configuration options it is just used as a run switch of some type and read rows 234-236(PHP) it says it needs config

also the http://nixos.org/nixos/manual/sec-configuration-syntax.html#sec-nix-syntax-summary is showing very clearly the possibilities. I say again I’m not into that engine but I think everything further to configure is done with the NixOS admin commands, it will be easier for me to help you if you explain what exactly you need done.