[Nix-dev] distutils2nix/python4nix

Marc Weber marco-oweber at gmx.de
Sun Sep 25 02:04:06 CEST 2011


Excerpts from Florian Friesdorf's message of Sun Sep 25 01:12:06 +0200 2011:
> I'd like to see a discussion on how to generate nix expressions, not on
> "why what we are currently doing is maybe not going to work out", I
> guess that was discussed enough in the past.
Don't get me wrong, please: "not working out" and "not scaling well" is
a difference! I know that generating .nix expression will work. But I
would not enjoy dozens of people committing their version of package
collections - one having a flag set to true, the next to false etc.

Eg cabal2nix *is* hardcoding flags in its Haskell code. It was
recommended recently. How do you efficiently test different flag
combinations for whatever reason (eg cause you're a maintainer?)

I don't say it doesn't work: You could create many cabal2nix branches
each having a different setting. You could also add command line options
to cabal2nix. then you still need many nixpkgs branches? How to use many
nixpkgs branches in nixos rebuild? .. (Yes, it can be done.)

If you start moving those flags into .nix files you will get different
sets of dependencies. Then you either can make the "dependency list"
generic as well - or you can pass more dependencies (and wait for ghc
building them) then required trusting cabal to only pick those required.

So yes, it will work. But it may not be perfect but good enough for most
use cases.

This applies to Haskell only. In Ruby and Python dependencies are
simpler. You don't have trees of choices. You're still likely to run
into runtime errors like "X requires version 2.0 or greater, but 1.8
found" unless you check version constraints which is not done when
generating .nix files individually. And that's the kind of "late
failure" I love most :)

But you're right. I'll shut up (unless being asked) and watch ..
I'm pretty sure that you know python better than I do - so go ahead and
get your job done.

Marc Weber


More information about the nix-dev mailing list