[Nix-dev] Haskell: Using Nix with cabal.config

Nikita Karetnikov nikita at karetnikov.org
Sun Feb 1 04:41:34 CET 2015


I’d like to build an application using the versions specified in a
cabal.config file (cabal-install is included in the shell.nix file).  Is
there an easy way to do it?

After talking to people on #nixos, I got the impression that having your
own Nixpkgs branch is the only way if you want to share your environment
with NixOS and plain Nix users.  Parsing a cabal.config file and running
cabal2nix on every package is not difficult.  But where do I need to put
the new recipes?

For packages with the default.nix file, you just compare the versions
and replace the existing recipe if they don’t match.  For packages
having multiple versions, you also need to change
pkgs/top-level/haskell-packages.nix.  The latter makes me a bit
uncomfortable because it’s easy to make a mistake.  I’d rather put all
the new recipes in a different place, say, in the directory of my
application, and somehow instruct Nix to use them first.  Can it be
done?  Or is there a better way?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150201/a498b11c/attachment.bin 


More information about the nix-dev mailing list