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

how to inject nix-node-dependencies #306

Open
hsjobeki opened this issue Sep 30, 2022 · 0 comments
Open

how to inject nix-node-dependencies #306

hsjobeki opened this issue Sep 30, 2022 · 0 comments

Comments

@hsjobeki
Copy link

hsjobeki commented Sep 30, 2022

Hey I am currently stuck with my problem:
I have a library packaged with the help of node2nix. (using rollup & typescript)

The Question:
In a project using that library, i want to use the packaged library.
How can i add the build output from that build (dist folder) to the node_modules generated by node2nix?

I dont want to use the npm registry or any private registry.

Is that currently supported ?

Just to make things clear: here is my build.nix step:

{ stdenv
, gitignoreSource
, package
, nodejs
, nodeDependencies
}:
stdenv.mkDerivation {
  src = gitignoreSource ../.;
  inherit (package) name;
  buildInputs = [ nodejs ];

  configurePhase = ''
    ln -s ${nodeDependencies}/lib/node_modules ./node_modules
    export PATH="${nodeDependencies}/bin:$PATH"
  '';

  buildPhase = ''
    npm run build
  '';

  installPhase = ''
    cp -r ./dist/ $out/
    cp package.json $out/
  '';
}
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