[Nix-dev] Using Nix for installing local projects
Marc Weber
marco-oweber at gmx.de
Wed Jun 27 16:27:39 CEST 2012
> Excerpts from Alexander Foremny's message of Wed Jun 27 15:23:44 +0200 2012:
Talking about Haskell its always good to know about your target
executable / library.
imaginary dependency relations:
Lib-A -> hoauth -> foo -> TARGET-EXECUTABLE
you want:
hoauth-patched -> foo' -> TARGET-EXECUTABLE'
solution 1)
The quick and dirty way is using ./Setup sdist or such and replace the
src attribute in nixpkgs - however this requires you to keep patches
against "official" nixpkgs. And that might influence other packages also
depending on the library..
solution 2)
use kind of magic deep overwriting (applyGlobalOverwrites) or such.
At This point Peter or Andres Loeh should reply - because they have
setup the current haskell packages system
solution 3)
use hack-nix: It differs from nixpkgs: It has a set packages it
knows about which I like to call "package pool".
By default its a limited set (latest versions found on hackage + some
manually selected older versions to keep things compiling).
Its advantage is that it does .cabal file dependency checking!
The downside is: it does .cabal file dependency checking using brute
force (and there are many ways to combine packages ..)
By limiting the pool you can still get good results on average cases.
Eg packaging hoauth was as much work as adding c library curl to the
buildInputs of the curl hackage package.. no more manual work was
required which took me about 15secs.
Then you can easily add dev packages to the pool. By giving them a
slightly higher version number - and the foo' and TARGET-EXECUTABLE'
will be the result.
See https://github.com/MarcWeber/hack-nix heading
"How to tell hack-nix about custom packages which are not yet on hackage"
Marc Weber
More information about the nix-dev
mailing list