carymrobbins / intellij-haskforce

Haskell plugin for IntelliJ IDEA
http://carymrobbins.github.io/intellij-haskforce/
Apache License 2.0
485 stars 41 forks source link

NixPkgs support #117

Open fatlazycat opened 9 years ago

fatlazycat commented 9 years ago

Any plans to add support for nix package mgt / nix shell etc ?

Thanks

jkozlowski commented 9 years ago

+1 Was going to ask the same question

jkozlowski commented 9 years ago

I think that simply being able to provide a command (as opposed to just a path) for tools like ghc-mod would work (maybe?). For example, with the setup described in http://wiki.ocharles.org.uk/Nix, the following works fine:

nix-shell -I ~ --command 'ghc-mod browse Database.Kdb.Internal.Types'
jkozlowski commented 9 years ago

I don't know if it's just luck, but the following started working for me like a charm:

nix-shell -I ~ --command 'open /Applications/IntelliJ\ IDEA\ 14\ CE.app/'

So just follow up the setup as described in the link above and then in your project directory (where the generated shell.nix is) start IntelliJ through nix-shell and suddenly ghc-mod spring up to life.

ekilah commented 5 years ago

for anyone who might end up here, this advice seems to work well still. I'm new to haskell, but I was at least able to get things like Jump to Definition working with this plugin via my Nix project.

from https://github.com/carymrobbins/intellij-haskforce/wiki/Quick-Start-Guide , you can follow the instructions to set up a new Cabal project, for instance, and the links to GHC and Cabal were automatically filled in for me if I started Intellij via nix-shell as suggested above by @jkozlowski (they were empty if I started intellij normally)

screen shot 2019-01-17 at 10 35 01 am

carymrobbins commented 5 years ago

Nice! Thanks @ekilah!