[Nix-dev] The Future of Haskell Packaging in Nix

Peter Simons simons at cryp.to
Thu Oct 15 10:21:10 CEST 2015


Hi William,

 >> We still don't have convincing answers to questions like: how do I
 >> compile my package with profiling support?
 >
 > I thought we already have fairly straightforward support for this via
 > overrides? I have been using this method:
 >
 > https://gist.github.com/jb55/af8b095b3ad97fb3035e
 >
 > and then just `nix-shell --arg profiling true` to build with profiling.

yes, you are right, that solution is pretty good.

I guess I'm just concerned about the complexity involved in this
seemingly simple operation. The average Haskell hacker is not going to
understand what that Nix code does and how it works, and they'll have a
hard time coming up with that themselves. Good documentation mitigates
those issues, no doubt. Still, it would be nice if there was a way to
simplify this. For example, for every package "foo" we have

  haskell.packages.ghcXYZ.foo.env

to enter an interactive shell environment. Why not define

  haskell.packages.ghcXYZ.foo.profiled

the same way? We could also have every package set contain a variant of
itself with profiling enabled. Then the names

  haskell.packages.ghcXYZ               -- default choice
  haskell.packages.ghcXYZ.profiled      -- with profiling
  haskell.packages.ghcXYZ.vanilla       -- without profiling

would be defined by Nixpkgs -- instead of requiring users to define a
"profiled" package set themselves.

Best regards,
Peter



More information about the nix-dev mailing list