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

Richard Wallace rwallace at thewallacepack.net
Thu Nov 1 00:30:07 CET 2012


This works well.  I found that if I didn't have the channel added, it
was building everything from scratch.  So I also added the channel and
then nix-env picked up the binaries correctly and picked up my added
package.  Is this ok?  Just want to make sure I'm not going to run
into something terrible resulting from this setup down the road.  Is
there another way for the pre-built binary package cache to be picked
up?

Rich

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