node2nix icon indicating copy to clipboard operation
node2nix copied to clipboard

overriding package dependecies

Open turboMaCk opened this issue 6 years ago • 2 comments

linking https://github.com/svanderburg/node2nix/issues/62 as it is partially related.

I wonder if there is a way to override package dependencies. I have a project and I generate nix expressions using node2nix from its package.json. however some of its dependecies fails to build. Those failures are actually closely related to issue https://github.com/svanderburg/node2nix/issues/123 and https://github.com/svanderburg/node2nix/issues/95 as the project uses webpack with image-min-webpack-plugin. I'm able and know how to use override on those packages to fix builds (when I use collection of packages generation) but I'm not sure how I can override dependencies of development package easily. I can probably change the generated files (and thuse make it hard to regenerate them) but I would like to avoid it.

Is it possible to override dependecies of package?

turboMaCk avatar Jul 10 '19 14:07 turboMaCk

btw also if anyone has even the dirtiest workaround of how to make this work in worst possible way please I would like to hear it. Otherwise it's not possible to build/work or do anything with project depending on this on NixOS (or at least I don't know how to make it work).

turboMaCk avatar Jul 10 '19 18:07 turboMaCk

I need this also. I have a project that depends on cypress for web testing. Cypress (npm package) depends on cypress (executable binary that is in Nix.) If you don't set an environment variable the npm package will try to download a binary on the fly.

I am able to override cypress as a top-level node2nix package in node-packages.json. However, I don't know how to inject this cypress that I've overridden as the cypress to use for my web project. I need an example.

The readme says this is possible https://github.com/svanderburg/node2nix#wrapping-or-patching-the-code-or-any-of-its-dependencies But doesn't provide an example.

dysinger avatar Feb 03 '21 03:02 dysinger