Nix NodeJS | 208 Members | |
| 58 Servers |
| Sender | Message | Time |
|---|---|---|
| 11 Sep 2023 | ||
* if I do this terrible thing, it works; sudo mkdir /lib64; sudo ln -s /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/ld-linux-x86-64.so.2 /lib64/ | 19:25:22 | |
would something bad happen if I found a way to create that symlink on switch? | 19:26:33 | |
| I want to keep the node repo pure of nix things, and I don't want to have to remember to patch things | 19:27:11 | |
| ok I did it, please don't hate me. https://github.com/vid/nixos/blob/main/playwright.nix#L54 | 19:34:14 | |
| You, uh, might be interested in nix-ld | 19:36:36 | |
programs.nix-ld.enable I think | 19:36:46 | |
In reply to @vid:matrix.org(I'm not gonna hate you don't worry 😅) | 19:37:14 | |
In reply to @vid:matrix.orgIdeally you can use the playwright from nixpkgs which I think has built-in drivers, but I understand if not | 19:38:16 | |
| (Stuff like nix-ld and envfs or nix-alien are for when you have to accept that you'll have to run prebuilt binaries that aren't packaged sometimes) | 19:39:01 | |
| (Also I'm not sure what this has to do with node.js really but I'm glad I could help I guess) | 19:39:27 | |
| 19:41:41 | ||
| 19:41:44 | ||
| oh that's interesting, thanks. I guess I still have to run a shell, but that's not too bad. Looking into it. you're right this is probably more general than node.js, but though maybe there's a specific workaround for using playwright with its node.js library (rather than packaged standalone version). | 19:41:45 | |
| * oh that's interesting, thanks. I guess I still have to run a shell, but that's not too bad. Looking into it. you're right this is probably more general than node.js, but thought maybe there's a specific workaround for using playwright with its node.js library (rather than packaged standalone version). | 19:42:55 | |
| hmm it looks like nix-ld … creates a symlink in /lib64 (-: but it expands on that | 19:45:21 | |
| ok, it requires wrapping each binary. no idea how that would work with a binary called by a library. and going to be a headache for every program I try. starting to look like I'll have to do this kind of dev in a vm | 19:51:04 | |
| 12 Sep 2023 | ||
| 11:28:11 | ||
| 11:33:24 | ||
| totally off the path now, but I wonder why chroot isn't used to solve these kinds of problems. seems more clean than nix-ld &c | 11:55:15 | |
| * totally off the path now, but I wonder why chroot isn't used to solve these kinds of problems. seems more clean than nix-ld &c, which require piling hacks on hacks | 11:57:51 | |
In reply to @vid:matrix.orgI mean I guess that's kinda what steam-run is (which is not steam-specific despite its name). Though that's technically bwrap, not chroot. Also now we're really getting away from being about nix node.js tooling 😛 | 11:59:32 | |
| yes and no? a nodeJS developer wants to use NixOS to run arbitrary nodeJS related programs, especially maybe going into the age of wasm. In my experience, it takes that person far off their productive happy path into hairy weirdo spiders and snakes. I tried steam-run, it worked as well as my symlink hack, it worked until it stopped working. I mean nodeJS is already infamous for bad distractions. so if a great NixOS nodeJS DX is the desired outcome, I kinda feel it's on topic. except popping into a chroot as a solution is probably a solved problem somewhere else. | 12:05:08 | |
| Yeah. I guess the "running arbitrary executables that crummy tooling auto-downloads" is a problem independent of node.js though, even if it does show up in some node.js packages (off the top of my head vcpkg also does that, unfortunately) | 12:07:20 | |
| one inflection might be this channel is for very NixOS specific development, whereas I'm talking about relating it to a general experience where if you have node/npm (or their equivalents) you're up for anything. NixOS specific development could be using a nix file instead of package.json, or nix specific directives, etc. | 12:07:33 | |
| I don't think we actually even have a topic technically set, so 🤷♀️ | 12:08:05 | |
| I'm fine with general node.js discussion on nix/nixpkgs/nixos here tbh. Not like it gets much activity anyway | 12:09:05 | |
| (I just don't have playwright- or node-specific answers for you on this particular problem. Someone else might though) | 12:10:17 | |
| I could point you at a repo if you're really bored / curious. clone https://github.com/withhaibun/haibun-e2e-tests then npm i; npm run build; npm run test counter | 12:14:27 | |
| I had to keep going so I created an ubuntu vm, but it's … not ideal | 12:16:12 | |
| Yeah the best we have for running arbitrary prebuilt files on nixos without modification is (the incredibly hacky) nix-ld + envfs + something like nix-alien or (the slightly less incredibly hacky) steam-run. If the latter broke though you could open a nixpkgs issue to get it fixed | 12:26:16 | |