[Nix-dev] Map Cabal Files To Nix Without Information Loss

John Ericson John_Ericson at Brown.edu
Tue Oct 20 16:16:06 CEST 2015


Skipping to your tentative proposal.

> Possible Improvements
> ---------------------
> 
> Nix expressions must capture the complete logic that the underlying
> Cabal file specifies. In case of the conduit example, the generated code
> should say:
> 
>     libraryHaskellDepends = [
>       base exceptions lifted-base mmorph mtl resourcet transformers
>       transformers-base
>     ] ++ stdenv.lib.optional (stdenv.lib.versionOlder ghc.version "7.9") void;
> 
> Furthermore, Cabal flags should be mapped to boolean function arguments
> that enable/disable the underlying feature and thereby modify how the
> Nix expression evaluates, so that no extraneous build inputs occur.
> 

I was thinking about how do craft the function for `callPackage` to respect
this. [One problem with the reflection trick is it breaks eta-expansion,
which greatly ties ours hand when trying to craft combinators, etc.]

  { base, ...etc...,
    void ? assert !(stdenv.lib.versionOlder ghc.version "7.9"); null
  }: ...

Seems to get the job, except how will ghc be in scope? There is a similar
staging issue with getting cabal flag args in scope before conditional deps.



More information about the nix-dev mailing list