Replace npm deps with nix deps

For some reasons (see motivation here) I need to use nix’s version of a node package instead of the one written in package.json. How can I tell nix to use all deps from package.json except one that should come from nix? (for now I use npmHooks.npmConfigHook + fetchNpmDeps but I’m happy to use anything that works)

1 Like

You could try to npm uninstall $PACKAGE the package(s) to override then npm link $PATH/TO/NIX-STORE during the installPhase
As you noted in your other post, patching is only a temporary fix for the current branch and not so reliable for the long term (need to keep an eye on changes on each releases)

Personal opinion here, but I would tend to avoid “nixifying” npm (same for e.g docker) stuff

  • more time to get it setup
  • time to maintain
  • npm already is a declarative way to setup dependencies
  • if working in a team, you can’t always force other members to use nix
    Would be relevant for hosts if you deploy smth there but still an overkill IMHO