| 9 Aug 2023 |
Lily Foster | In reply to @countoren:matrix.org is it NPM_TOKEN env that we need to set? Yeah and it'll need to be read here (and support for HTTP Authorization header added to the util function): https://github.com/NixOS/nixpkgs/blob/fe7a15579219350f23135e9e8ee35b7423ae06ef/pkgs/build-support/node/fetch-npm-deps/src/parse/mod.rs#L160 | 18:53:08 |
Lily Foster | I'll try to hack something up later today. If I implement, could I get you to test it? | 18:53:37 |
Lily Foster | In reply to @lily:lily.flowers Yeah and it'll need to be read here (and support for HTTP Authorization header added to the util function): https://github.com/NixOS/nixpkgs/blob/fe7a15579219350f23135e9e8ee35b7423ae06ef/pkgs/build-support/node/fetch-npm-deps/src/parse/mod.rs#L160 And it should be added to the list of impure env vars here: https://github.com/NixOS/nixpkgs/blob/cd6d4800edca7c9765f40a4416569911d7952b30/pkgs/build-support/node/fetch-npm-deps/default.nix#L168 | 18:55:35 |
countoren | sure | 19:26:10 |
countoren | I could test if you got something. | 19:34:22 |
Lily Foster | In reply to @countoren:matrix.org I could test if you got something. Okay, thank you! I'll probably have something in ~3 hours or so | 19:35:08 |
countoren | Lily Foster: do you know how can I manually add dependencies to a package built by buildNodePackage | 20:07:49 |
countoren | was trying to override with more nativeBuildInputs but it does not seem to work | 20:08:27 |
Lily Foster | What sort of dependencies? Like other node dependencies? | 20:20:31 |
countoren | yes I am fighting angular/cli which should build the project to have the other npm dependency listed in its ng --version command | 20:22:11 |
countoren | it seems that if i will go into a shell it will have everything it needs while in nix build it is lucking some like angular-build | 20:23:02 |
countoren | * it seems that if i will go into a shell it will have everything it needs while in nix build it is lucking some like build-angular | 20:26:25 |
countoren | * yes I am fighting angular/cli which should build the project to have the other npm dependencies listed in its ng --version command | 20:26:37 |
Lily Foster | How are you adding angular? Is it not a devDependency in package.json? | 20:32:14 |
countoren | I was trying couple of ways: 1) from supplement.json/nix 2) in nativeBuildInputs override package proeprty | 20:34:12 |
countoren | using nodePackage."@angular/cli" | 20:34:23 |
countoren | the thing is the project as old deps | 20:34:35 |
countoren | supplements are old versions | 20:34:44 |
countoren | supplements has older version of angular/cli | 20:43:20 |
countoren | but trying to use this version that is generated by node2nix has missing dependencies like build-angular | 20:43:53 |
countoren | * supplements has older version of angular/cli(8.3.21) | 20:45:07 |
countoren | will I be able to use fetchNpmDeps in order to download 8.3.21? | 20:46:30 |
Lily Foster | fetchNpmDeps downloads whatever versions are in the package-lock.json file | 21:27:01 |
Lily Foster | If it's the old versions then it'll use the old versions | 21:27:12 |
Lily Foster | Also we are looking to deprecate the nodePackages set at some point because it's bitrot pretty bad at this point and has architectural issues | 21:28:28 |
countoren | what will be the differnece between fetchNpmDeps to node2nix? | 23:26:00 |
Lily Foster | In reply to @countoren:matrix.org I could test if you got something. Okay I made a thing for passing in an environment variable that looks like NIX_NPM_TOKENS='{"regsistry.fontawesome.com":"token"}'. Do you think you could apply this patch to your nixpkgs and see if you can set NIX_NPM_TOKENS on your builder/nix daemon? https://github.com/lilyinstarlight/nixpkgs/compare/5a8e9243812ba528000995b294292d3b5e120947...24f435dd88b47f53011bc1f296fd0347699ef451.diff | 23:27:22 |
countoren | yes for sure | 23:27:40 |
Lily Foster | In reply to @countoren:matrix.org what will be the differnece between fetchNpmDeps to node2nix? node2nix generates nix expressions and does its own locking of dependencies needed for a node package. It also includes (questionable...) build logic to turn those into a coherent package with built libraries, cli scripts, and such. fetchNpmDeps just reads an existing package-lock.json and downloads those deps in a way that npm can find them later when in the nix sandbox (which has no internet). buildNpmPackage includes hooks that have their own build logic to turn an npm application into a coherent package | 23:29:15 |
Lily Foster | (node2nix sorta does both fetching deps and building a package but in a significantly different paradigm. It's unmaintained these days though) | 23:30:22 |