Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate specific list of dependencies for devDependencies #325

Open
lfdominguez opened this issue Jan 30, 2024 · 1 comment
Open

Generate specific list of dependencies for devDependencies #325

lfdominguez opened this issue Jan 30, 2024 · 1 comment

Comments

@lfdominguez
Copy link

lfdominguez commented Jan 30, 2024

Hi, thanks for this great project.

I'm really trying hard to build a NextJS project using node2nix. I can't use the package-lock.json because devs don't want to use Nix and use the package-lock version 3 that is not supported by node2nix.

Furthermore, I can suggest that on the node-packages.nix if you use the -d arg to node-nix not to merge the nodeDependencies from devDependencies and dependencies?? My focus is that devDependencies it's in theory only for build process, but not for runtime, then if I need a build step on my project need to execute node2nix with -d and this will add so many dependencies to my runtime final derivation that I don't want.

On the node-packages.nix creation process then can be created the current nodeDependencies but if -d is used then put nodeDependenciesDist with only the dependencies and not the devDependencies. Is this possible?

@lfdominguez
Copy link
Author

Right now my workaround is run node2nix two times (a lot of time wasted, but it's only the first time) with different args:

  • -d -o node-packages-dev.nix
  • -o node-packages-dist.nix

Then on my flake.nix:

nodePackagesDev = import ./node-packages-dev.nix {
  inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
  inherit nodeEnv;
};

nodePackagesDist = import ./node-packages-dist.nix {
  inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
  inherit nodeEnv;
};

nodeDependenciesDev = nodePackagesDev.nodeDependencies.override {
  buildInputs = with pkgs;[ pkg-config vips.dev pixman cairo.dev pango.dev ];
};

nodeDependenciesDist = nodePackagesDist.nodeDependencies.override {
  buildInputs = with pkgs;[ pkg-config vips.dev pixman cairo.dev pango.dev ];
};

And use each one on needed steps of my derivation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant