[Nix-dev] Hackage -> Nix
Marc Weber
marco-oweber at gmx.de
Tue Nov 24 21:41:29 CET 2009
Summary: hack-nix + haskell-nix-overlay enables you to
a) keep up to date with hackage
b) resolve haskell dependencies automatically based on .cabal file input
(and manual patches). A workflow is provided to create those patches fast
c) integrate your own haskell packages easily
d) I don't think one setup is enough to build all packages.
Thus I've written a command which builds an environment used to build
a cabal project only. This is described below.
HOWTO build a .cabal project
============================
hack-nix supports building environments now.
So you should be able to do
# write a config file containing cabal flag assignments:
hack-nix --write-hack-nix-cabal-config
# throw away the ways you don't want to test and assign appropriate names
$EDITOR .hack-nix-cabal-config
# build an environment based on those flags:
hack-nix --build-env $NAME
# source the bash file setting PATH and GHC_PACKAGE_PATH
# in order to run the well known cabal commands:
source hack-nix-env/$NAME/source-me/haskel-env
ghc --make Setup.hs
./Setup configure ...
./Setup build
You can also add dev versions of packages to the list of available
packages quite easily:
Add to ~/.nixpkgs/config.nix:
config.hackNix.additionalPackages = [
(import $PATH_TO_CABAL_REPO/dist/$CABAL_PROJECT_NAME.nix)
];
The $CABAL_PROJECT_NAME.nix file is created by running
$ hack-nix --to-nix
I will announce this solution on haskell-cafe soon because I don't want
to do all the work to make all packages compile. Maybe someone else can
help doing so.
Marc Weber
More information about the nix-dev
mailing list