Nix NodeJS | 199 Members | |
| 57 Servers |
| Sender | Message | Time |
|---|---|---|
| 29 Apr 2024 | ||
| 22:24:45 | |
*
I'm not using buildNpmPackage because I'm also calling php's composer and I don't know how to combine different builders... | 22:24:55 | |
In reply to @matejam:matrix.orgyou can do a postBuild script, or you can mix and match build hooks (idk how to deal with composer) | 22:25:26 | |
| (but you don't have to use either if you don't want to (assuming FOD unreproducibility isn't a problem for what you're doing)) | 22:26:20 | |
In reply to @samasaur:matrix.org(and yes, this is probably the immediate cause of the error) | 22:26:36 | |
In reply to @samasaur:matrix.orgThat does something, now I have a different error message 😄 EACCES: permission denied, mkdir '/homeless-shelter' | 22:27:03 | |
In reply to @matejam:matrix.orgyeahh it's gonna be a lot of things like that which the npm hooks already handle (there's, uh, a lot of edge cases) | 22:27:44 | |
| https://github.com/NixOS/nix/issues/670#issuecomment-1211700127 | 22:28:33 | |
| looks like this linked comment should solve your issue | 22:28:42 | |
at the start of buildPhase, run export HOME=$(pwd) | 22:29:07 | |
| but lily is correct that we're really re-solving problems that the npm hooks have already solved | 22:29:46 | |
| 22:34:36 | |
*
Yeah, sadly that seems to be the case... After adding | 22:35:02 | |
| 30 Apr 2024 | ||
| 20:07:37 | ||
| 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 | |
In reply to @matejam:matrix.orgyou need nodejs in nativeBuildInputs | 20:31:43 | |
you may also optionally need nodejs.python in nativeBuildInputs and nodejs in buildInputs if it has c++ libs | 20:32:43 | |
and ++ lib.optionals stdenv.isDarwin [ darwin.cctools ] on nativeBuildInputs if it has c++ libs too, for darwin | 20:33:06 | |
| I 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 | |
| do you need nodejs_18? | 20:34:49 | |
| (fetcher shouldn't actually even need nodejs at all 🤔) | 20:35:16 | |
| Maybe 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 | |
| I think that project used nodejs_16 but I'm okay with changing the version | 20:38:15 | |
i mean you can just use the nodejs attr which should always be latest LTS | 20:44:07 | |
| unless it has C++ code in which case, nodejs breaks that a little between versions and you may want to pin one | 20:44:28 | |
| (fwiw current LTS is nodejs_22 as of a few days ago) | 20:45:20 | |
| (apparently) | 20:45:26 | |
| Here's a working version: https://github.com/MatejaMaric/yota-laravel/blob/c114ebc3c725a67a19d148a95543ed307094c659/derivation.nix Thanks a lot Lily! 🤗 | 20:45:42 | |
| oh heck yeah, that's awesome :) | 20:45:58 | |
Yeah, I'll pin it. I had to add | 20:46:28 | |