Nix NodeJS | 209 Members | |
| 59 Servers |
| Sender | Message | Time |
|---|---|---|
| 3 Jan 2024 | ||
| Can't wait to push this >2GB package to the server :/ | 14:00:35 | |
| 6 Jan 2024 | ||
| 21:08:15 | ||
| 7 Jan 2024 | ||
| Hi, two things. First thing I am hoping to learn to package JS/TS programs, I am fairly early in my nix journey but have read through the nix pills and had a look through the manuals but I am finding the interop with npm lock files a bit of a blocker to my understanding. It seems as if the prevailing solution is to use “generators” to create nix files from the lock files, but I am unsure as to whether that is just for ad hoc packaging or if the same approach is used within This leads me on to the second thing which is that https://github.com/microsoft/vscode-js-debug seems to be included somewhere to be available to VSCode but I don’t think it’s available standalone from | 10:45:53 | |
| Heyo everyone, I'd like to tell nixpkgs's buildNpmPackage which node version to use: nodejs_21 in my case. How can I do it? I could override the https://github.com/NixOS/nixpkgs/blob/43eec8711993f851dc4f5dec16c0cb2fdb2b1d3a/pkgs/build-support/node/build-npm-package/default.nix#L4 | 19:02:40 | |
In reply to @pkolloch:matrix.org buildNpmPackage { ...; nodejs = nodejs_21; } | 19:03:51 | |
In reply to @lily:lily.flowersThank you! https://github.com/NixOS/nixpkgs/blob/43eec8711993f851dc4f5dec16c0cb2fdb2b1d3a/pkgs/build-support/node/build-npm-package/default.nix#L46 | 19:05:17 | |
| 9 Jan 2024 | ||
| 00:59:28 | ||
| Hi! I'm trying to package a NextJS NPM project with Nix, and I currently am able to build it on aarch64-darwin and x86_64-darwin, but not on Linux, and I really have no idea where to go from here | 01:00:29 | |
| The project is https://github.com/Remote-Text/remote-text-client/tree/nix-flake | 01:01:04 | |
| and the issue I get when building on x86_64-linux is
| 01:02:08 | |
I tried adding pkgs.cypress to buildInputs and/or nativeBuildInputs, but neither seemed to fix the problem | 01:02:40 | |
I believe that darwin's nix config defaults to the sandbox being disabled, so that's probably why it builds there. (one could verify this assumption with --option sandbox true on macOS or --option sandbox false on Linux. | 01:09:40 | |
From googling, it looks like there's a CYPRESS_RUN_BINARY and CYPRESS_INSTALL_BINARY variable which allows you to set it to an existing path. | 01:13:10 | |
In reply to @julia:the-apothecary.club nix build . --sandbox still works on Darwin, so I think that's not it | 01:13:44 | |
* From googling, it looks like there's a CYPRESS_RUN_BINARY and CYPRESS_INSTALL_BINARY variable which allows you to set it to an existing path. (https://docs.cypress.io/guides/references/advanced-installation) | 01:13:47 | |
| Yes, but it's disabled by default. | 01:13:52 | |
right but doesn't --sandbox enable it? so if it still builds with the sandbox, then that's not the issue? | 01:14:57 | |
| ah. | 01:16:21 | |
In reply to @julia:the-apothecary.clubYeah, you're right. I think this should still work though, cause the issue on Linux is trying to access the internet (which isn't possible in a sandbox). | 01:17:16 | |
so maybe set CYPRESS_INSTALL_BINARY=0 (to skip binary installs) and then set CYPRESS_RUN_BINARY=${pkgs.cypress}/bin/Cypress? | 01:20:49 | |
| will give it a shot | 01:20:58 | |
| Here's someone else's package using cypress: https://github.com/NixOS/nixpkgs/blob/d405cc8e0e47f8c45f72729000395f3eb3f73a70/pkgs/servers/monitoring/uptime-kuma/default.nix#L24 | 01:22:19 | |
| (there's a few of those) | 01:22:45 | |
| thanks! | 01:23:18 | |
In reply to @samasaur:matrix.orgalso this appears to have worked! | 01:23:24 | |
based on that package you linked I would think that CYPRESS_RUN_BINARY is unnecessary but I will leave it in there | 01:23:54 | |
| coolios. I guess mac must not download cypress? or do something different. which is kinda weird. | 01:24:09 | |
| honestly i think you were right and it's a sandboxing thing. i cannot prove it but i vaguely recall seeing a similar error initially on mac and doing weird NPM stuff outside of nix until it worked. so maybe that's still having an impact | 01:25:29 | |
In reply to @samasaur:matrix.org actually, is this with a clean nix store / new build because | 01:26:24 | |
In reply to @samasaur:matrix.org* actually, is this with a clean nix store / new build? because | 01:26:29 | |