|The following procedure only works when the ghc version of the lts resolver matches the one used for installing Stack.|
Setting up a working Intero/Spacemacs environment is not that easy. The following method does not use a
- Install Stack
stack. Install it
Current used version is
1.6.5 x86_64 as defined by the nixpkgs stable 18.03 channel.
- Build with Stack
resolver: lts-11.17 nix: enable: true packages: - zlib.dev - gcc - ruby - pkgconfig system-ghc: true skip-ghc-check: true
Stack downloads all the haskell libs but it seems to do so in a global user space (?)
removing $PROJECT/.stack-workwon’t erase them.
- Install intero
Even if you install
Interoin user space with
stack install interoinside a nix shell (
nix-shell -p gcc 'haskellPackages.ghcWithPackages(p: with p; [syb ghc-paths mtl network random])') it would not be recognize within
This is true with
The only way seems to let
interothe first time. This will work only if
gccare on the
$PATH. You will need to add those to
The installation will work but it won’t find intero because it believe it is in
x86_64-linux-nixfolder that does not exist. The easy fix is to add a symlink:
cd $HOME/.stack/compiler-tools; ln -s x86_64-linux x86_64-linux-nix.
With stack version < 1.7 you will need to forcefully enable nix in
nix: enable: true
If you don’t, intero will try to install
ghcand it will fail.