[Nix-dev] Proper way of adding custom nix expressions

Daniel Santa Cruz dstcruz at gmail.com
Thu Nov 1 00:05:22 CET 2012


I'm interested in figuring out what is standing in the way of getting
hack-nix as the standard way of doing things.  From my very naive point of
view, that is what I would want as the end user.  This deal of having to
create a nix expression for every package, and for every version of that
package does not appeal to me very much.  I understand that in a day to day
scenario, it is not "that bad", but the hack-nix approach would seem "oh,
so nice".

I would feel like I have given more to the community if the entire hackage
was instantly available via nix, rather than by creating nix expressions by
hand for them.  I already did some of that, as can be seen by some of the
packages for Snap and for Yesod, but I have moved away from it.  For fast
moving projects, manually creating nix expressions is an extra effort that
I would like to be able to avoid.

Daniel


On Wed, Oct 31, 2012 at 6:51 PM, Richard Wallace <
rwallace at thewallacepack.net> wrote:

> Thanks, I think I'll give this a try.  hack-nix is more comprehensive,
> but I'd like to see if I can contribute to the community.
>
> On Wed, Oct 31, 2012 at 2:01 PM, Peter Simons <simons at cryp.to> wrote:
> > Hi Richard,
> >
> >  > It seems like ~/.nix-defexpr is the place I should add anything
> custom.
> >
> > yes, that is true. Personally, I have a checked-out copy of the Git
> > repository from http://github.com/nixos/nixpkgs at that location. Adding
> > 'boomerang' is then just a matter of running the commands:
> >
> >   $ cd .nix-defexpr/pkgs/development/libraries/haskell/
> >   $ mkdir boomerang
> >   $ cabal2nix cabal://boomerang >boomerang/default.nix
> >
> > Now, add the line
> >
> >    boomerang = callPackage ../development/libraries/haskell/boomerang {};
> >
> > to ~/.nix-defexpr/pkgs/top-level/haskell-packages.nix, and test the
> > build with the compiler of your choice:
> >
> >   $ nix-env -p /tmp/test -iA haskellPackages_ghc742.boomerang
> >   installing `haskell-boomerang-ghc7.4.2-1.3.3'
> >   these derivations will be built:
> >
> /nix/store/dv8a9bvnsqkv3b6kykfk16dmqjshh32s-haskell-boomerang-ghc7.4.2-1.3.3.drv
> >   [...]
> >   [...]
> >   patching ELF executables and libraries
> >   patching script interpreter paths
> >   building path(s)
> `/nix/store/kybjzfbk54q8qn7jwv7v82ah7nz7nird-user-environment'
> >   created 22 symlinks in user environment
> >
> > Finally, commit the result and open a pull request. :-)
> >
> > Take care,
> > Peter
> >
> > _______________________________________________
> > 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/20121031/568f2af4/attachment.html 


More information about the nix-dev mailing list