nix-community/NixNG

use with php-composer-builder flake overlay

Closed this issue · 4 comments

Hi! thanks for the good work!

I'm trying to create a php-fpm service whose package has been built using pkgs.api.buildComposerProject from project https://github.com/loophp/nix-php-composer-builder.

But that creates problems I don't understand. Here is a reproducible case: https://github.com/docteurklein/kubenix-test

rror: attribute 'api' missing

       at /nix/store/6j0r74pgvi0bg9c7f3b9ln5s5m04wwyd-source/nixng/phpweb.nix:29:20:

           29|         package = (pkgs.api.buildComposerProject {
             |                    ^
           30|           src = ./php;

Note that the nixpkgs package works well:

           28|         # package = pkgs.php.withExtensions({enabled, all}: enabled ++ [ all.imagick ]);

so I suspect a problem with overlays.
Any idea?

Thanks a lot.

I managed to get rid of this, but now I get:

error: builder for '/nix/store/jwwqwy1lrfnrx5x3cpk19kffwfps258b-php.ini.drv' failed with exit code 1;
       last 1 log lines:
       > cat: /nix/store/gxalgv04nh9c55n6q9hkm1rav9h4pzgs-test-1.0.0-dev/etc/php.ini: No such file or directory
       For full logs, run 'nix log /nix/store/jwwqwy1lrfnrx5x3cpk19kffwfps258b-php.ini.drv'.
error: 1 dependencies of derivation '/nix/store/xy3x8dxj0rff062xzdirfnah4q5qghxj-php-fpm-main-run.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mg0iaqvcwzpv2b3ix4c99xw50593x17a-php-fpm-main-run.drv' failed to build
error: 1 dependencies of derivation '/nix/store/y7vc0s5x6nayjhrqfbf6rvac32s214yj-service-dir.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fps4gr1yjg8lcqfcyf8wlhrhfb0dlq7f-activation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/94pwwhl8pchsa07mbzh6mr8vpc3w1g7q-nixng-phpweb.drv' failed to build
error: 1 dependencies of derivation '/nix/store/h8lirjp12ihh94m4axgv5k4avcxwhfff-config.json.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8xj415lgidx9c64w8pcpx91pl511ws18-image-phpweb.json.drv' failed to build
drupol commented

This issue can be closed since the PHP/Composer builder has been merged in nixpkgs.

I noticed this as well and started using the upstream version, but the real problem lies in the phpfpm service module:
https://github.com/NixOS/nixpkgs/blob/042d50a96cf55880914d007946a8c8182c9a6a48/nixos/modules/services/web-servers/phpfpm/default.nix#L31

it assumes the phpPackage will always contain /etc/php.ini, which is not the case with those apis.

A hack I found is https://github.com/docteurklein/nixok/blob/208201b5ca137982abcc388290c7eba9c46172e5/flake.nix#L109-L112

Anyway, this can be closed indeed! Thanks for the answer :)

drupol commented

This issue could easily be fixed upstream, how about opening an issue on nixpkgs and we'll deal with it asap?