ashinkarov / nvim-agda

Agda interaction pluging for neovim
36 stars 5 forks source link

Instructions for nix-managed neovim #4

Closed siers closed 2 years ago

siers commented 2 years ago

Sveiks Artem!

Are there any instructions available for managing this for neovim installed with nix?

I saw you have contributions somewhere in nix repos regarding neovim, so perhaps you can offer some minimal config? I have a working neovim nix derivation already, but just adding nvim-agda to the packages list didn't seem to do what's necessary. I might've installed it together with https://github.com/derekelkins/agda-vim — could that be an issue? Are they mutually exclusive?

ashinkarov commented 2 years ago

Hi!

I would be surprised if two agda plugins installed simultaneously work as expected :) In essence, the problem is that both of them do something based on the .agda file extension. I guess it will depend on order of plugin inclusion, or something like this. Bottom line: I wouldn't risk it, leave only one plugin in your config.

As for nixos, it is crucial for agda-nvim to access the luautf8 library. I have extended home-manager to do this correctly, have a look here for details: https://github.com/nix-community/home-manager/pull/2617

When the derivation of neovim with luautf8 works, all that is needed is to add the package. I am not on a nixos machine right now, but this is all I have in my neovim configs:

require "paq" {
    -- ...
    "ashinkarov/nvim-agda";
}

-- If you want to specify custom version of agda
local g = vim.g
g.nvim_agda_settings = {
    agda = "/home/tema/.local/bin/agda"
}
siers commented 2 years ago

I got it to work. I installed luautf8 with the nixpkgs neovim config with extraLuaPackages. I hope this serves as inspiration to get it to work for someone who's googling at some later point. :)