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

Richard Wallace rwallace at thewallacepack.net
Wed Oct 31 23:51:01 CET 2012


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


More information about the nix-dev mailing list