!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

81 Members
A room for PHP developers running on Nix23 Servers

Load older messages


SenderMessageTime
17 Aug 2022
@greaka:greaka.degreaka ⚡️ joined the room.20:21:45
18 Aug 2022
@drupol:matrix.orgPolThanks !05:27:03
@Zevran:matrix.orgGaël Reyrol Hi, I am trying to install the yaml extension from a flake setup with home-manager, but I can't find a way to do it. I tried environment.systemPackages = with pkgs; [ php81Extensions.yaml (php81.withExtensions ({ enabled, all }: with all; [ yaml ])) ]; but when I run php -m, it does not show the extension. I started Nix/NixOS a few weeks ago so please excuse me for my newbieness. 09:46:52
@jtojnar:matrix.orgJan Tojnar
In reply to @Zevran:matrix.org
Hi, I am trying to install the yaml extension from a flake setup with home-manager, but I can't find a way to do it. I tried environment.systemPackages = with pkgs; [ php81Extensions.yaml (php81.withExtensions ({ enabled, all }: with all; [ yaml ])) ]; but when I run php -m, it does not show the extension. I started Nix/NixOS a few weeks ago so please excuse me for my newbieness.
drop php81Extensions.yaml from environment.systemPackages, it is useless there – PHP extensions only matter in php.withPackages or php.buildEnv
11:05:42
@jtojnar:matrix.orgJan Tojnar and try using all.yaml inside withExtensionswith statement can be confusing , which scope does the value come from, see https://nix.dev/anti-patterns/language#with-attrset-expression 11:07:11
@Zevran:matrix.orgGaël Reyrol
In reply to @jtojnar:matrix.org
and try using all.yaml inside withExtensionswith statement can be confusing , which scope does the value come from, see https://nix.dev/anti-patterns/language#with-attrset-expression
Thanks for your reply, you said extensions only matter in php.withPackages or php.buildEnv so should I use php.withExtensions ?
12:29:56
@jtojnar:matrix.orgJan Tojnar Gaël Reyrol: if you want to have PHP with the extensions enabled then yes 12:39:19
@drupol:matrix.orgPol Gaël Reyrol: I made a package which reads the composer.json file and infer the extensions to load. 18:09:05
@drupol:matrix.orgPolMaybe you'll find it useful. Find it here: https://github.com/loophp/nix-shell/18:10:01
@drupol:matrix.orgPolA team of ~10 people is using it everyday without any issue since a bit less than a year now.18:10:26
19 Aug 2022
@Zevran:matrix.orgGaël Reyrol
In reply to @drupol:matrix.org
Maybe you'll find it useful. Find it here: https://github.com/loophp/nix-shell/
Thx ! It works like a charm <3, it would be nice to have the composer lib available from phpcs to include multiple composer files in the case of a monorepo ;)
07:52:37
@drupol:matrix.orgPolWhat do you mean?07:54:22
@drupol:matrix.orgPolWhat is the "composer lib" ?07:55:07
@Zevran:matrix.orgGaël Reyrol
In reply to @drupol:matrix.org
What is the "composer lib" ?
The function that get extensions from composer requirements
08:03:33
@drupol:matrix.orgPolOoooh I see.08:04:02
@drupol:matrix.orgPolIt is actually.08:04:19
@drupol:matrix.orgPolhttps://github.com/loophp/nix-shell/blob/master/src/phps.nix#L508:04:48
@drupol:matrix.orgPolYou can include this file and enjoy it08:04:56
@drupol:matrix.orgPolI guess there are room for improvements and features, feel free to suggest what I could do08:05:21
@Zevran:matrix.orgGaël Reyrol
In reply to @drupol:matrix.org
I guess there are room for improvements and features, feel free to suggest what I could do
Sure but I need to learn a bit more about Nix lang :)
08:15:36
@drupol:matrix.orgPol The problem that I have is that if you want to read a user file, then you must add --impure, it's mandatory. It's ugly I know, but it works well. 08:15:43
@drupol:matrix.orgPolSame here, I'm learning everyday :)08:15:57
@drupol:matrix.orgPolLet me know if you have any question I can assist you with, don't hesitate.08:16:15
@Zevran:matrix.orgGaël ReyrolRedacted or Malformed Event08:16:38
@drupol:matrix.orgPoland I speak french, so, hit me up in private if it's' easier.08:17:49
@Zevran:matrix.orgGaël Reyrol
In reply to @drupol:matrix.org
Let me know if you have any question I can assist you with, don't hesitate.
Thanks, I have one last question, I am looking into making PHPStorm aware of the nix dev shell
08:18:10
@drupol:matrix.orgPolYou have to run PHPStorm from the shell08:18:27
@drupol:matrix.orgPolThis is how we do08:18:32
@Zevran:matrix.orgGaël ReyrolOkay, I was trying to find a plugin that would be able to do that 08:19:04
@drupol:matrix.orgPolCouldn't find a better solution yet08:19:14

Show newer messages


Back to Room ListRoom Version: 6