[Nix-dev] Haskell-env (via nix-shell) - am I doing this right?
Peter Jones
mlists at pmade.com
Fri May 22 20:16:02 CEST 2015
Matthias Beyer <mail at beyermatthias.de> writes:
> I want to develop a haskell package, but I need haskell packages from
> haskellngPackages (what's the matter with haskellPackages vs.
> haskellngPackages?).
>
> So, I'm a bit insecure about my environment definition here, because I
> had to mix the non-ng-packages with the ng-packages to get the
> cabalInstall and everything (I'm rather new to Haskell, so maybe I
> completely messed up here.
I thought I'd chime in with how I'm developing Haskell package on NixOS.
I wouldn't say this is the correct way to do things, and I'm completely
open to feedback.
To start out, I'm using HaskellNG and a recent version of nixpkgs where
HaskellNG is the default. Here are the components I use with some
examples:
1) I write a default.nix that describes my dependencies:
https://github.com/pjones/byline/blob/master/default.nix
2) I write a shell.nix that pulls in default.nix using import:
https://github.com/pjones/byline/blob/master/shell.nix
3) The ghc argument in shell.nix allows me to specify different
versions of GHC so I can test with multiple versions. (I'd love
some feedback on how to make this more flexible.) This can be used
from the command line like so:
nix-shell --argstr ghc 7.10.1
# or
nix-shell --argstr ghc 7.8.4
4) Once I'm inside nix-shell I use the buildPhase variable to build my
package:
eval $buildPhase
Again, any suggestions on how to improve this workflow are appreciated.
--
Peter Jones, Founder, Devalot.com
Defending the honor of good code
More information about the nix-dev
mailing list