All Projects → michalrus → intero-nix-shim

michalrus / intero-nix-shim

Licence: Apache-2.0 License
Intero Haskell IDE with Nix instead of Stack

Programming Languages

haskell
3896 projects
Nix
1067 projects
Makefile
30231 projects
shell
77523 projects
c
50402 projects - #5 most used programming language
emacs lisp
2029 projects

Build Status

intero-nix-shim


WARNING

This project will probably never work with multiple Cabal targets per project — too much effort to emulate this behavior of the original Stack. See issues #7, #6.

We suggest using Dante, which works very well with Cabal@Nix (incl. multiple targets), or HIE, after haskell/haskell-ide-engine#357 is ready.


High-level view

You need to have default.nix and shell.nix defined for your project, see https://nixos.org/nixpkgs/manual/#how-to-create-nix-builds-for-your-own-private-haskell-packages.

Emacs’ intero-stack-executable variable needs to point to /nix/store/…-intero-nix-shim-…/bin/intero-nix-shim.

You can set it to just "intero-nix-shim", if it’s available in your global PATH. (By default, that variable is set to "stack".)

Simple how to

There are several ways to achieve the above.

Probably, the simplest one would be to install intero-nix-shim globally in your PATH, e.g., if you’re on nixos-17.03:

# /etc/nixos/configuration.nix

{
  environment.systemPackages = [
    haskellPackages.intero-nix-shim
  ];
}

… and set intero-stack-executable to just "intero-nix-shim" in .dir-locals.el for your project:

;; your-project/.dir-locals.el

((nil . ((intero-stack-executable . "intero-nix-shim"))))

Warning: if you choose the .dir-locals.el way, Emacs has a security mechanism to prevent untrusted code execution. You will have to accept this setting. If you use global-intero-mode, Intero will start loading before you manage to whitelist this setting. Therefore, the first time, it will fail. Just do M-x intero-restart.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].