[Nix-dev] How to get ghc-mod to work with nix-shell

Paul Koerbitz paul.koerbitz at gmail.com
Mon Dec 1 20:24:30 CET 2014


On Mon, Dec 1, 2014 at 6:44 PM, John Wiegley <johnw at newartisans.com> wrote:

>
> I run Emacs from within the nix-shell environment.
>
>
I've thought of this too, but I usually have emacs running several days,
working on multiple projects, so it's not really ideal for me.

But thanks to your input, I've come up with putting the following bash
script into $HOME/bin (which is the first directory on my path) and calling
it ghc-modi:

~~~{.bash}

#!/usr/bin/env bash
function upsearch () {
    test "/" == "$PWD" && return || test -e "$1" && echo "found: " "$PWD"
&& return || cd .. && upsearch "$1"
}
upsearch "default.nix"
exec nix-shell --pure --command ghc-modi $@

~~~

It's a hack, of course, but seems to work well enough (I do seem to have
some other collisions between my haskell mode and ghc-mod, but at least the
latter seems to work now).

thank you!
Paul


John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20141201/8f0cde60/attachment.html 


More information about the nix-dev mailing list