Re: [Nix-dev] $snapshot not evaluating

2016-02-04 Thread Tuomas Tynkkynen
On 02/04/2016 09:31 AM, stewart mackenzie wrote:
> Hello,
>
>[...]
> Notice $snapshot isn't evaluated.
>
> Is there a way for me to get $snapshot evaluated without copying over
> all the code from nixpkgs yet simply overriding the configureFlags?
> (example code I'd need to copy over
> https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/rustc/generic.nix#L33-L119)


Typically you do something like this:

preConfigure = ''
 configureFlagsArray+=("--local-rust-root=$snapshot")
'';
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Custom php.ini for cli calls

2016-02-04 Thread 4levels
Hi Nix Devs,

I'm trying to increase the memory_limit settings for php cli calls.
For the phpfpm calls I've managed (a few months ago) to append my custom
options to the php.ini file as the phpfpm service has an option to do so.
However, for php cli calls, the memory_limit value is usually set to
unlimited, but not with the default config in the nix package: it has a
value of 128M (instead of the expected -1).

In the php/default.nix I can see that the ini file is generated in the
installPhase, but I'm failing to override this.

Do you have any suggestions on how to achieve this?


Kind regards,

Erik

Working phpfpm custom ini snippet:

# Custom PHP ini file for apc / memcached
services.phpfpm.phpIni = pkgs.runCommand "php.ini" {
  options = ''
date.timezone = Europe/Brussels
extension = "${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so"
max_execution_time = 30
post_max_size = 100M
upload_max_size = 100M
upload_max_filesize = 20M
memory_limit = 256M
apc.enable = 1
  '';
}
''
  cat ${pkgs.php}/etc/php-recommended.ini > $out
  echo "$options" >> $out
'';
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Custom php.ini for cli calls

2016-02-04 Thread Guillaume Maudoux (Layus)
Hi,

I found a hint on StackOverflow[1], which outlines that php is not the
product of a makeDerivation, but instead is a composableDerivation.
More info on these strange beasts can be found in the source itself[2],
with php being explicitly cited as an exception.
Once you know it, you notice it at the top of php/default.nix :-).

Basically, |overrideDerivation| is not available for php; instead you
have the choice between |merge| and |replace|

This works for me :

|# In .nixpkgs/config.nix : packageOverrides = pkgs: with pkgs; rec {
php70 = pkgs.php70.merge (oldAttrs: { installPhase = '' # use the old
installPhase if need be ${oldAttrs.installPhase} # Add custom stuff echo
"Strange option" >> $iniFile ''; }); }; |

[1]
http://stackoverflow.com/questions/23660797/nix-composable-derivation-options
[2]
https://github.com/NixOS/nixpkgs/blob/master/lib/composable-derivation.nix

Le 04/02/16 15:52, 4levels a écrit :

> Hi Nix Devs,
>
> I'm trying to increase the memory_limit settings for php cli calls.
> For the phpfpm calls I've managed (a few months ago) to append my
> custom options to the php.ini file as the phpfpm service has an option
> to do so.
> However, for php cli calls, the memory_limit value is usually set to
> unlimited, but not with the default config in the nix package: it has
> a value of 128M (instead of the expected -1).  
>
> In the php/default.nix I can see that the ini file is generated in the
> installPhase, but I'm failing to override this.
>
> Do you have any suggestions on how to achieve this?
>
>
> Kind regards,
>
> Erik
>
> Working phpfpm custom ini snippet:
>
> # Custom PHP ini file for apc / memcached
> services.phpfpm.phpIni = pkgs.runCommand "php.ini" {
>   options = ''
> date.timezone = Europe/Brussels
> extension = "${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so"
> max_execution_time = 30
> post_max_size = 100M
> upload_max_size = 100M
> upload_max_filesize = 20M
> memory_limit = 256M
> apc.enable = 1
>   '';
> }
> ''
>   cat ${pkgs.php}/etc/php-recommended.ini > $out
>   echo "$options" >> $out
> '';
>
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] $snapshot not evaluating

2016-02-04 Thread stewart mackenzie
That seemed to have helped quite a bit! Still not there yet!

On Thu, Feb 4, 2016 at 8:34 PM, Tuomas Tynkkynen
 wrote:
> Typically you do something like this:
>
> preConfigure = ''
> configureFlagsArray+=("--local-rust-root=$snapshot")
> '';
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Custom php.ini for cli calls

2016-02-04 Thread Guillaume Maudoux (Layus)
That being said, you can also start php with the right arguments.
It seems to me that php does not read any configuration file from the
derivation when it starts.

$ php --ini
Configuration File (php.ini) Path:
/nix/store/hr30lz6ziqinsbi525fm9han3lr9nsmj-php-5.6.16/etc
Loaded Configuration File: (none)
Scan for additional .ini files in: /etc
Additional .ini files parsed:  (none)

so you probably need to put your own php.ini file in /etc or call php -c


Nothing to do with the derivation :-).

Layus.

Le 04/02/16 17:14, Guillaume Maudoux (Layus) a écrit :
>
> Hi,
>
> I found a hint on StackOverflow[1], which outlines that php is not the
> product of a makeDerivation, but instead is a composableDerivation.
> More info on these strange beasts can be found in the source
> itself[2], with php being explicitly cited as an exception.
> Once you know it, you notice it at the top of php/default.nix :-).
>
> Basically, |overrideDerivation| is not available for php; instead you
> have the choice between |merge| and |replace|
>
> This works for me :
>
> |# In .nixpkgs/config.nix : packageOverrides = pkgs: with pkgs; rec {
> php70 = pkgs.php70.merge (oldAttrs: { installPhase = '' # use the old
> installPhase if need be ${oldAttrs.installPhase} # Add custom stuff
> echo "Strange option" >> $iniFile ''; }); }; |
>
> [1]
> http://stackoverflow.com/questions/23660797/nix-composable-derivation-options
> [2]
> https://github.com/NixOS/nixpkgs/blob/master/lib/composable-derivation.nix
>
> Le 04/02/16 15:52, 4levels a écrit :
>
>> Hi Nix Devs,
>>
>> I'm trying to increase the memory_limit settings for php cli calls.
>> For the phpfpm calls I've managed (a few months ago) to append my
>> custom options to the php.ini file as the phpfpm service has an
>> option to do so.
>> However, for php cli calls, the memory_limit value is usually set to
>> unlimited, but not with the default config in the nix package: it has
>> a value of 128M (instead of the expected -1).  
>>
>> In the php/default.nix I can see that the ini file is generated in
>> the installPhase, but I'm failing to override this.
>>
>> Do you have any suggestions on how to achieve this?
>>
>>
>> Kind regards,
>>
>> Erik
>>
>> Working phpfpm custom ini snippet:
>>
>> # Custom PHP ini file for apc / memcached
>> services.phpfpm.phpIni = pkgs.runCommand "php.ini" {
>>   options = ''
>> date.timezone = Europe/Brussels
>> extension = "${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so"
>> max_execution_time = 30
>> post_max_size = 100M
>> upload_max_size = 100M
>> upload_max_filesize = 20M
>> memory_limit = 256M
>> apc.enable = 1
>>   '';
>> }
>> ''
>>   cat ${pkgs.php}/etc/php-recommended.ini > $out
>>   echo "$options" >> $out
>> '';
>>
>>
>> ___
>> nix-dev mailing list
>> nix-dev@lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev