!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

153 Members
48 Servers

Load older messages


SenderMessageTime
29 Apr 2024
@matejam:matrix.orgmatejam

but lily is correct that we're really re-solving problems that the npm hooks have already solved
Yeah, sadly that seems to be the case... After adding export HOME=$(pwd) I have a illegal path references in fixed-output derivation error.
I'll try using hooks tomorrow or some other day. If somebody already has an example of a packaged Laravel application feel free to send it to me. It's a bit convoluted since it mixes php and nodejs (Laravel Mix)...

22:34:36
@matejam:matrix.orgmatejam *

but lily is correct that we're really re-solving problems that the npm hooks have already solved

Yeah, sadly that seems to be the case... After adding export HOME=$(pwd) I have a illegal path references in fixed-output derivation error.
I'll try using hooks tomorrow or some other day. If somebody already has an example of a packaged Laravel application feel free to send it to me. It's a bit convoluted since it mixes php and nodejs (Laravel Mix)...

22:35:02
30 Apr 2024
@dominic_:matrix.org@dominic_:matrix.org left the room.20:07:37
@matejam:matrix.orgmatejam So, I made a new derivation that tries to mix buildComposerProject with fetchNpmDeps and npmHooks. Here's the link: https://github.com/MatejaMaric/yota-laravel/blob/7c2879793e752efbb92a1a419e77a64cffaf1a59/derivation.nix
It returns the error /nix/store/2wd77cc3g2r9iqb7iwlgd881zvh6f576-npm-config-hook/nix-support/setup-hook: line 84: npm: command not found.
20:31:18
@lily:lily.flowersLily Foster
In reply to @matejam:matrix.org
So, I made a new derivation that tries to mix buildComposerProject with fetchNpmDeps and npmHooks. Here's the link: https://github.com/MatejaMaric/yota-laravel/blob/7c2879793e752efbb92a1a419e77a64cffaf1a59/derivation.nix
It returns the error /nix/store/2wd77cc3g2r9iqb7iwlgd881zvh6f576-npm-config-hook/nix-support/setup-hook: line 84: npm: command not found.
you need nodejs in nativeBuildInputs
20:31:43
@lily:lily.flowersLily Foster you may also optionally need nodejs.python in nativeBuildInputs and nodejs in buildInputs if it has c++ libs 20:32:43
@lily:lily.flowersLily Foster and ++ lib.optionals stdenv.isDarwin [ darwin.cctools ] on nativeBuildInputs if it has c++ libs too, for darwin 20:33:06
@matejam:matrix.orgmatejamI saw that fetchNpmDeps is able to automatically use nodejs_18. Should I also just specify nodejs_18 or is there some mechanism to automatically determine the version?20:34:04
@lily:lily.flowersLily Fosterdo you need nodejs_18?20:34:49
@lily:lily.flowersLily Foster(fetcher shouldn't actually even need nodejs at all 🤔)20:35:16
@matejam:matrix.orgmatejamMaybe I'm wrong about nodejs_18, but I'm quite sure I saw it in the logs at some point. Anyway, in my previous fixed-point derivation I had to update my package-lock.json and with fetchNpmDeps I didn't have to do that which I really like 😄20:37:20
@matejam:matrix.orgmatejamI think that project used nodejs_16 but I'm okay with changing the version20:38:15
@lily:lily.flowersLily Foster i mean you can just use the nodejs attr which should always be latest LTS 20:44:07
@lily:lily.flowersLily Fosterunless it has C++ code in which case, nodejs breaks that a little between versions and you may want to pin one20:44:28
@lily:lily.flowersLily Foster(fwiw current LTS is nodejs_22 as of a few days ago)20:45:20
@lily:lily.flowersLily Foster(apparently)20:45:26
@matejam:matrix.orgmatejamHere's a working version: https://github.com/MatejaMaric/yota-laravel/blob/c114ebc3c725a67a19d148a95543ed307094c659/derivation.nix Thanks a lot Lily! 🤗20:45:42
@lily:lily.flowersLily Fosteroh heck yeah, that's awesome :)20:45:58
@matejam:matrix.orgmatejam

unless it has C++ code in which case, nodejs breaks that a little between versions and you may want to pin one

Yeah, I'll pin it. I had to add NODE_OPTIONS="--openssl-legacy-provider"; for SSL to work so I guess I do use C++

20:46:28
@lily:lily.flowersLily Foster
In reply to @matejam:matrix.org
Here's a working version: https://github.com/MatejaMaric/yota-laravel/blob/c114ebc3c725a67a19d148a95543ed307094c659/derivation.nix
Thanks a lot Lily! 🤗
(if you want, you can set npmBuildScript = "prod" and include npmBuildHook as well)
20:46:36
@lily:lily.flowersLily Foster
In reply to @matejam:matrix.org
Here's a working version: https://github.com/MatejaMaric/yota-laravel/blob/c114ebc3c725a67a19d148a95543ed307094c659/derivation.nix
Thanks a lot Lily! 🤗
* (if you want, you can set npmBuildScript = "prod" and include npmBuildHook as well and remove the postBuild)
20:46:41
@c0ba1t:matrix.orgCobaltIirc, the nodejs 22 LTS has some problems with node gyp. You might want to stick with 18 for a few more weeks until testing has been done20:46:49
@lily:lily.flowersLily Foster
In reply to @c0ba1t:matrix.org
Iirc, the nodejs 22 LTS has some problems with node gyp. You might want to stick with 18 for a few more weeks until testing has been done
well if they're using npmHooks and nodejs, it'll be 20 for a bit
20:47:13
@lily:lily.flowersLily Foster i don't think nixpkgs has set nodejs = nodejs_22 yet (just node_20) 20:47:27
@lily:lily.flowersLily Foster
In reply to @c0ba1t:matrix.org
Iirc, the nodejs 22 LTS has some problems with node gyp. You might want to stick with 18 for a few more weeks until testing has been done
(also what problems? that's concerning if their build tool didn't work on release....)
20:47:44
@lily:lily.flowersLily Foster (i guess it is nodejs admittedly) 20:47:54
@matejam:matrix.orgmatejam

(if you want, you can set npmBuildScript = "prod" and include npmBuildHook as well and remove the postBuild)

Hm, for some reason if I do that it doesn't generate files that npm run prod generates in $src/share/php/yota-laravel/public/ where I want them.

20:56:46
@c0ba1t:matrix.orgCobaltIirc, it is on 22 on unstable. I don't remember the specifics but an unstable bum recently made our builds fail until we returned to 18. Iirc, it was similar to https://github.com/nodejs/node-gyp/issues/302920:59:57
@lily:lily.flowersLily Foster
In reply to @matejam:matrix.org

(if you want, you can set npmBuildScript = "prod" and include npmBuildHook as well and remove the postBuild)

Hm, for some reason if I do that it doesn't generate files that npm run prod generates in $src/share/php/yota-laravel/public/ where I want them.

share derivation? (e.g. on a pastebin?) that seems weird
21:00:53
@lily:lily.flowersLily Fosteroh you know what21:01:00

Show newer messages


Back to Room ListRoom Version: 6