[Haskell-cafe] Nix for Hackage/Cabal

Marc Weber marco-oweber at gmx.de
Fri Jul 6 16:54:40 EDT 2007


> > of Cabal's functionality like finding compilers and such.
> I was under the impression that it didn't work on Windows. From another
> quick look at the website, it looks like that's right. Does anybody
> happen to know otherwise?

It actually does. I've managed to compile it.
You have one major problem when trying to install nix from source on
windows: You need another lex/ bison version. I've already proposed
adding the parser files to the svn repository so that this problem would
be gone. I didn't check that this already has happened.
GHC is not yet supported on windows. But adding the binary installer
shouldn't be hard.

On windows there are some minor quirks with symlinks. And you need NTFS
(fat32 doesn't work).. 

each package description (it's called derivation) has an property
builder. This is a script which sources another basch script defining
default targets (unpack, build, ...). But you can specify any other
executable to do the build task.

Beeing totally pure means also that you have to download a lot of
packages more than once (linux header files glibc etc ...)
Because nix won't use the ones beeing installed by your system.
This doesn't matter as you can use NixOs. I think more than one
developper is using NixOS as main os. But you will have to hack a lot to
get what you already have.. (I think. I haven't tried yet)..

I'm currently working on moving all hackagedb packages to nix with
automatic dependency resolving.
I already have list of package descriptions from the hackage site which
looks roughly like this (thus each package chooses which dependencies it
needs by selector functions filtering the whole hackage package list by
itself..)


<start list>
  ({ cabaldeps=[
  ({descr="base"; filter_func=d : ("base" == d.id.name);})
  ({descr="parsec"; filter_func=d : ("parsec" == d.id.name);})
  ({descr="mtl"; filter_func=d : ("mtl" == d.id.name);})
  ({descr="template-haskell"; filter_func=d : ("template_haskell" == d.id.name);}) ];
 name="harpy";
 src="http://hackage.haskell.org/packages/archive/harpy/0.2/harpy-0.2.tar.gz";
 version=[(0) (2) ];
})
....
<end list>

The cool thing: You can not only automatically download/ compile
dependencies but also distribute the packages and update by
automatically generated binary diffs (you should read the nix manual to
get more accurate information because I still feel like a noob).

I'll post another message to the nix dev list so that the main
developpers can give a more accurate status report if they wish.

Marc Weber


More information about the Haskell-Cafe mailing list