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

zimbatm zimbatm at zimbatm.com
Wed Sep 7 11:32:57 CEST 2016


I don't think there is an official list. Here is the ones I know of:

Go/GOPATH: go2nix
Ruby/Rubygems: bundix
Java/Maven: mvn2nix-maven-plugin
Node/npm: npm2nix (multiple implementations)
Haskell/Cabal: cabal2nix

And I think there are some for Perl/CPAN, Ocaml/??? and .NET/Nuget too. The
manual is supposed to cover each developer environment for each language.

It would be nice if we could come up with a universal XXX2nix that has a
unified interface, but then it's probably a lot of work to find the lowest
common denominator. All of those tools also generate different nix outputs,
some just generate the repository metadata, some also generate an
accompanying default.nix.



On Wed, 7 Sep 2016 at 09:04 Roger Qiu <roger.qiu at matrix.ai> wrote:

> 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
>>
> _______________________________________________
> 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/b12f6a12/attachment.html>


More information about the nix-dev mailing list