| 12 Mar 2022 |
Pol | Yes | 22:34:55 |
ramsey | I bet grahamc (he/him) could shed some light on that 🙂 | 22:35:26 |
Pol | Or the current PHP maintainers ! | 22:36:35 |
ramsey | PHP maintainers wouldn’t be able to explain why Nix wants to build the Phars from source rather than use the pre-built Phars from the Composer package maintainers | 22:38:01 |
Pol | I think Jan Tojnar might ! | 22:38:33 |
ramsey | Oh. You mean the Nix PHP maintainers? | 22:39:09 |
Pol | In reply to @ramsey:matrix.org I'm trying to set up a development environment with nix pkgs, and Phive is one of the tools I need in that environment 🙂 You might want to have a look at what I use everyday: https://GitHub.com/loophp/nix-shell | 22:39:26 |
Pol | In reply to @ramsey:matrix.org Oh. You mean the Nix PHP maintainers? Yes :) | 22:39:37 |
ramsey | I thought you meant the PHP internals developers 🤣 | 22:39:54 |
Pol | Sorry about the confusion | 22:40:04 |
ramsey | No worries | 22:40:44 |
Pol | Going to turn off the lights here, I'll continue tomorrow | 22:42:11 |
Pol | It's midnight, I need some sleep | 22:42:25 |
ramsey | Good night! | 22:56:37 |
ramsey | So, using php80Extensions.xdebug doesn't automatically add Xdebug to the php.ini file. How would I configure that in default.nix? | 23:01:44 |
ramsey | I honestly have no idea what I'm doing 😆 | 23:13:55 |
ramsey | this hasn't really helped me get set up: https://nixos.org/manual/nixpkgs/stable/#sec-php | 23:14:49 |
ramsey | 'cause clearly this is wrong:
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/bacbfd713b4781a4a82c1f390f8fe21ae3b8b95b.tar.gz") {} }:
php.buildEnv {
extensions = { all, ... }: with all; [ xdebug ];
}
| 23:15:35 |
ramsey | (my default.nix) | 23:15:49 |
Jan Tojnar | In reply to @ramsey:matrix.org
'cause clearly this is wrong:
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/bacbfd713b4781a4a82c1f390f8fe21ae3b8b95b.tar.gz") {} }:
php.buildEnv {
extensions = { all, ... }: with all; [ xdebug ];
}
that should work (though you will also want to keep the enabled) | 23:34:23 |
ramsey | it tells me that it doesn't recognize php as a variable name | 23:34:57 |
Jan Tojnar | oh, right, you need to use pkgs.php | 23:35:20 |
Jan Tojnar | In Nix, like in most programming languages, only variables that are explicitly introduced into scope are available to use | 23:36:06 |
ramsey | I don't know how to include pkgs.php | 23:36:28 |
Jan Tojnar | it should be available inside the function body (since the function takes pkgs as an argument) | 23:37:12 |
Jan Tojnar | * pkgs should be available inside the function body (since the function takes pkgs as an argument) | 23:37:21 |
ramsey | this tutorial doesn't give me any indication of how to include packages: https://nixos.org/guides/dev-environment.html | 23:37:26 |
ramsey | and reading about it here doesn't show me how to add it to my default.nix file: https://search.nixos.org/packages?channel=21.11&show=php&from=0&size=50&sort=relevance&type=packages&query=php | 23:38:00 |
Jan Tojnar | you can do something like:
let
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/bacbfd713b4781a4a82c1f390f8fe21ae3b8b95b.tar.gz") {};
in
pkgs.php.buildEnv {
extensions = { all, enabled ... }: enabled ++ (with all; [ xdebug ]);
}
| 23:39:09 |
ramsey | how am I supposed to know that? Is that in a tutorial that I'm missing? | 23:39:44 |