[Nix-dev] A Journey into our brand-new Haskell infrastructure: Part II

Thomas Tuegel ttuegel at gmail.com
Mon Jan 12 16:41:35 CET 2015


On Sun, Jan 11, 2015 at 1:41 PM, Peter Simons <simons at cryp.to> wrote:
> The topic of today's posting is: Fixing Build Failures!
>
>
> I know all about Cabal builds. How can I override a Nix build environment?
> --------------------------------------------------------------------------
>
>   Every Haskell expression expects an argument called "mkDerivation" -- the
>   function that builds the derivation from the build description. You can
>   modify the environment of a build "foo" by replacing mkDerivation with a
>   version that applies some function "f" to the expression first:
>
>   | foo.override (args: args // {
>   |   mkDerivation = expr: args.mkDerivation (expr // f expr);
>   | })
>
>   All Haskell configuration modules import the 'lib' library
>   <https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/lib.nix>
>   that defines a bunch of neat little helper functions on top of this basic
>   mechanism. Just check out out the configuration-XYZ.nix files to see some
>   examples of how these functions are used.

How can I override a package to enable profiling? Is there an obvious
way in general to apply the same override to a package and all its
dependencies? Or, if it's impossible to generally override all of a
package's dependencies, is there special support for profiling?

-- 
Thomas Tuegel


More information about the nix-dev mailing list