Re: [Nix-dev] development environments

2013-02-24 Thread Marc Weber
The overlay dumps the hackage package information into a .nix file.
Then a nix code tries to determine dependencies based on (eventually
patched) cabal file contents creating the .nix derivations on the fly
depending on what you asked for.

Because brute force is used only a limited set of haskell package
versions is used when resolving dependencies.

Advantage: Very often it just works.
Disadvantage: If it does not it still requires some debugging and patching.

Depeding on cadal flags the right dependencies are chosen automatically.

Eg if you have


foo-1.0

dependencies:
  if flag-A
LIB_IF
  else
LIB_ELSE

Then either LIB_IF or LIB_ELSE will be passed as build input depending
on flag configuration.

Darcs on its own has more than 8 flags, thus there are 2**8 different
ways to configure it (not counting slightly different versions in the
dependencies). Thus in theory its strong enough to find a working
configuration, but in the real world there are too many ways, which is
why its me setting sane defaults.

Because the whole dependency chain is calculated on the fly its possible
to inject your own dev version of a packages:

Eg make darcs depend on bytestring-my- version.

Because dependencies are calculated on the fly, and the end result is
only a script you install into a directory specific profile you can have
multiple profiles.

  source ./ghc-6.0-setup # then compile with ghc-6.0

2nd shell:

  source ./ghc-7.x-setup # then compile with ghc-7.x

Thus testing multiple configurations at the same time using different
shells is made easy.

Because I don't do much Haskell at the moment the hackage dump I created
is a couple of month old. If you're interested I can show you how to
update it yourself.

Marc Weber
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] development environments

2013-02-23 Thread Marc Weber
Excerpts from Lucas Paul's message of Fri Feb 22 21:13:54 +0100 2013:
 I'm just learning how to make software in nix (with some help from the
 wiki). If I want to use an IDE, say Leksah, should that be in the
 build environment too, or should I install that into my default
 profile?
build environment, because leksah uses ghc internal features, such
depends on your build env such as ghc version AFAIK.

Of course if you use the same set of libraries always, installing it
into your default profile may be more convenient.

Maybe try both, and keep using what works best for you.

At this point in time I also want to remind that there is a second way
for install haskell packages using nixpkgs
https://nixos.org/wiki/Nixpkgs-haskell-overlay

Marc Weber
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] development environments

2013-02-23 Thread Lucas Paul
I found the Haskell overlay interesting, but I'm left with only a
vague idea about what problem it's solving, and how. It mentioned
darcs as an example, but I didn't grasp the difference between
installing darcs with and without the overlay. Could you elaborate a
bit?

On Sat, Feb 23, 2013 at 1:02 AM, Marc Weber marco-owe...@gmx.de wrote:
 Excerpts from Lucas Paul's message of Fri Feb 22 21:13:54 +0100 2013:
 I'm just learning how to make software in nix (with some help from the
 wiki). If I want to use an IDE, say Leksah, should that be in the
 build environment too, or should I install that into my default
 profile?
 build environment, because leksah uses ghc internal features, such
 depends on your build env such as ghc version AFAIK.

 Of course if you use the same set of libraries always, installing it
 into your default profile may be more convenient.

 Maybe try both, and keep using what works best for you.

 At this point in time I also want to remind that there is a second way
 for install haskell packages using nixpkgs
 https://nixos.org/wiki/Nixpkgs-haskell-overlay

 Marc Weber
 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev