[Nix-dev] Build a default.nix for a project with node.js and python dependencies

Sander van der Burg svanderburg at gmail.com
Mon Sep 5 23:25:15 CEST 2016


A bit difficult to give a very concrete answer, since there are many ways
to create hybrid packages.

Anyway, a possible strategy is to create a derivation/package that runs pip
and keeps the resulting output source tree. Then use node2nix to generate
Nix expressions from package.json file that is in the same project.

Then override the node2nix generated expression (see the README.md of
node2nix how to do this) and point the src = parameter to the derivation
that runs pip (and keeps the corresponding source tree).

Quite a bit of hacking, but if the steps that you describe are correct,
then I expect it to work.


On Mon, Sep 5, 2016 at 5:22 PM, Dmitry Malikov <malikov.d.y at gmail.com>
wrote:

> Hey guys,
>
> There is a project with node.js and python dependencies which is need to
> be run inside an isolated environment.
>
> Right now the whole flow consists of 3 steps:
>
>    - pip install -r requirements.txt --upgrade
>    - npm install
>    - npm run build
>
> What I'm looking for is a single default.nix file built basing on
> dependencies listed in 'requirements.txt' and 'package.json' files,
> allowing to do these steps via 'nix-shell' command.
>
> Could you please point me at the right direction?
>
> Thanks.
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160905/646bdfdc/attachment.html>


More information about the nix-dev mailing list