[Nix-dev] Modifying expressions generated by cabal2nix

Peter Simons simons at cryp.to
Sun Sep 18 01:16:00 CEST 2011


Hi Alexander,

 > How to modify expressions generated by cabal2nix and be sure that
 > changes will be ported during following (automatic?) updates?

please feel free to update, change, or improve any Haskell package
as you see fit. After you have done so, please open an issue at

  http://github.com/haskell4nix/cabal2nix/issues

to report the need for manual patching. We will then try to adapt
cabal2nix so that it generates the expression correctly in the
future. If you dislike bug trackers for some reason, you can post a
quick note to this mailing list, too. What matters is just that
Andres and I are aware of the change.

In case you'd like to hack cabal2nix, you'll find that most changes
can be accomplished through one of these modules:

 - http://github.com/haskell4nix/cabal2nix/blob/master/src/Cabal2Nix/Name.hs
   maps Cabal dependency names to Nix attributes,

 - http://github.com/haskell4nix/cabal2nix/blob/master/src/Cabal2Nix/Flags.hs
   configures non-standard Cabal flags that ought to be specified at
   build time (you'll find that xmonad-extras is already in there),

 - http://github.com/haskell4nix/cabal2nix/blob/master/src/Cabal2Nix/PostProcess.hs
   contains patches to the generated Nix expression, i.e. addition
   of undeclared dependencies, etc.

I hope this helps!

Take care,
Peter



More information about the nix-dev mailing list