I’m trying to replicate the configuration from this article on a NixOS:
That’s, I’m trying to use hie on neovim, through coc.nvim, with NixOS as operating system. For now, I want it to work for a project which uses GHC 8.6.5 through Stack.
So far I’ve been able to:
- Install hie version for GHC 8.6.5:
let
all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {};
in
{
environment.systemPackages = with pkgs; [
(all-hies.selection { selector = p: { inherit (p) ghc865; }; })
];
}
- Install neovim 4.x to have floating window feauture, which is only available in master, as far as I know:
let
nixPkgsMaster = import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/master") {};
in
{
environment.systemPackages = with pkgs; [
nixPkgsMaster.neovim
];
}
-
I configured coc.nvim to use hie. I think everything is correct from this side.
-
I found that having hie for GHC 8.6.5 was not enough and that I had to install manually the compiler for 8.6.5. I think it is needed in NixOS. If I’m wrong, please, tell me. So, I added the following in
environment.systemPackages
:
haskell.compiler.ghc865
- Besides, I have following haskell tools:
haskellPackages.hlint
haskellPackages.apply-refact
haskellPackages.hindent
With all of that, hie is somehow working on neovim, but there are a lot of things missing.
For example, one thing that is working is :call CocAction('format')
. It also points me to some hlint warnings underlying their lines.
However, there are a lot of functionalities missing.
- Autocompletion is anything but intellisense.
- I can’t quickfix hlint warnings. It says
[coc.nvim] No quickfix action available
. - Trying to rename returns me
[coc.nvim] Error on 'rename': rename: "HaRe: file not loaded for refactoring"
- It gives me no type information when I press
K
on a word (beingK
mapped as coc.nvim suggests)
I think that my NixOS configuration is the culprit here, because I’m not too experienced with it and I see it needs to be very specific when configuring haskell. I’m wondering if I’m missing some extra haskell package. I tried with haskell.packages.ghc865.hoogle
hoping it would make a difference in showing me types or documentation, but no luck here.
Thanks for any insight you can give me.