[Nix-dev] haskell-ng: shell.nix magic to infer .env?

Peter Simons simons at cryp.to
Wed Feb 25 10:45:18 CET 2015


Hi Mateusz,

 > With old Haskell setup we'd essentially have a shell.nix that was a bit like
 >
 > let
 >   pkgs = import <nixpkgs> {}
 >   some_stuff = …;
 > in some_stuff.callPackage ./. {};
 >
 > or some variation thereof. This allowed us to both nix-shell *and*
 > nix-build shell.nix out of the box. But with haskell-ng we end up with
 >
 > (some_stuff.callPackage ./. {}).env;
 >
 > which is all fine and dandy for when we want a shell but nix-build no
 > longer Just Works™.

just omit the ".env" part from the expression above. Then running

  $ nix-build shell.nix

will build the package, and

  $ nix-shell -A env

will give you an interactive environment.

Best regards,
Peter



More information about the nix-dev mailing list