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

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Tue Feb 24 23:34:09 CET 2015


Hi,

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™. If we try to nix-build such expression in complains
that it's meant for interactive use only. Is there any way to recover
old behaviour? I imagine if we can tell if we're entering a nix-shell or
not then we can switch inside the expr and use .env when appropriate but
I don't know how to achieve this.

Thanks

-- 
Mateusz K.


More information about the nix-dev mailing list