[Nix-dev] ghc-mod + nix-shell?

Richard Wallace rwallace at thewallacepack.net
Wed Aug 20 23:40:00 CEST 2014


Ok, that works.  I think it always worked, but I didn't realize it because
I was only trying to use it from vim and was running into the problem of
the command being in the wrong place.  Works great now, thanks!


On Wed, Aug 20, 2014 at 10:24 AM, Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk
> wrote:

> On 08/20/2014 05:10 PM, Richard Wallace wrote:
> > I've been struggling to get this working.  I have ghc-mod installed, but
> it
> > fails to see the packages I have installed when I go into nix-shell.  If
> > you did get it working, could you post your .nix file somewhere so I (and
> > others) can take a look?
> >
> > Thanks,
> > Rich
> >
> >
>
> I did not get it to fully work as I would have liked but not due to
> ‘can't see packages’ issue. You'll of course need the changes from [1].
>
> Simply adding ghcMod to build inputs should work. Here is a shell.nix
> for a project:
>
> --
> let pkgs = import <nixpkgs> {};
>     myHaskellPackages = pkgs.myHaskellPackages;
>     haskellPackages = myHaskellPackages.override {
>       extension = self: super: {
>         tsuntsun = self.callPackage ./. myHaskellPackages;
>       };
>     };
> in pkgs.lib.overrideDerivation haskellPackages.tsuntsun (attrs: {
>   buildInputs = [ pkgs.emacs haskellPackages.cabalInstall
> haskellPackages.ghcMod_5_0_1 ] ++ attrs.buildInputs;
> })
> --
>
> With this after you nix-shell --pure it should work. Seems ghc-mod does
> some meddling with cabal so you might have to run cabal configure first.
> Both ghc-mod and ghc-modi should work from the shell at this point.
>
> The next problem is that emacs currently hangs. I think it tries to use
> ghc-modi and waits for that process to exit but due to the nature of
> ghc-modi, it just waits forever. I don't know if it's a problem with the
> ELisp shipped with ghc-mod package or the way I wrapped ghc-modi. See my
> comment at bottom of [1]. If you can figure out how to proceed from here
> then I'd love to hear about it. For now I'm back to just GHCi where I
> can and cabal repl where I can't.
>
> [1]: https://github.com/NixOS/nixpkgs/pull/3689
>
> --
> Mateusz K.
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140820/d8b1ca01/attachment.html 


More information about the nix-dev mailing list