Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use with php-composer-builder flake overlay #31

Closed
docteurklein opened this issue Sep 7, 2023 · 4 comments
Closed

use with php-composer-builder flake overlay #31

docteurklein opened this issue Sep 7, 2023 · 4 comments

Comments

@docteurklein
Copy link

docteurklein commented Sep 7, 2023

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.

@docteurklein docteurklein changed the title compose with php-composer-builder flake overlay use with php-composer-builder flake overlay Sep 7, 2023
@docteurklein
Copy link
Author

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
Copy link

drupol commented Oct 2, 2023

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

@docteurklein
Copy link
Author

docteurklein commented Oct 3, 2023

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
Copy link

drupol commented Oct 3, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants