31

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!

Athan Clark
  • 3,886
  • 2
  • 21
  • 39
  • 1
    Looking for this as well. – clord Jul 23 '14 at 19:15
  • They are set as flags in the PHP's derivation. You can override the flags in your configuration.nix or config.nix, but if you really want to change things up in the compilation, you have to actually create your own derivation. – CMCDragonkai Jul 28 '14 at 11:58
  • I found this .nix file https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/php/5.4.nix for php composableDerivation if that's helpful when building php modules with nix-build. This seems to be on github when adding custom packages when you build php specific packages if that's what you're asking. If you're trying to add php package to the nixos their add custom package section instructs that's how its done unless its done differently from other users. – unixmiah Jan 20 '15 at 19:24

2 Answers2

3

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);  };
as.
  • 825
  • 1
  • 8
  • 19
0

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.

Voodoo22
  • 28
  • 4