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

Roger Qiu roger.qiu at matrix.ai
Wed Sep 7 10:04:36 CEST 2016


Is there a list of projects that go from other package managers to nix?
On 06/09/2016 11:57 AM, "Rok Garbas" <rok at garbas.si> wrote:

> to generate nix expressions from pip's requirements.txt file i created
> pypi2nix[1] which should get you very close.
>
> [1] https://github.com/garbas/pypi2nix
>
> On Mon, Sep 5, 2016 at 11:25 PM, Sander van der Burg
> <svanderburg at gmail.com> wrote:
> > 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
> >>
> >
> >
> > _______________________________________________
> > nix-dev mailing list
> > nix-dev at lists.science.uu.nl
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
> >
>
>
>
> --
> Rok Garbas
> https://garbas.si
> _______________________________________________
> 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/20160907/e09df729/attachment-0001.html>


More information about the nix-dev mailing list