feat(nvim): setup lua_ls
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
39fb08bc48
commit
b0323e5fe1
1 changed files with 28 additions and 1 deletions
|
@ -6,12 +6,39 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (config.vars) neovimIde;
|
inherit (config.vars) neovimIde;
|
||||||
inherit (pkgs) vimPlugins;
|
inherit (pkgs) vimPlugins;
|
||||||
|
|
||||||
|
flakeEnv = config.programs.bash.sessionVariables.FLAKE;
|
||||||
in
|
in
|
||||||
lib.mkIf neovimIde {
|
lib.mkIf neovimIde {
|
||||||
programs = {
|
programs = {
|
||||||
neovim = {
|
neovim = {
|
||||||
|
extraPackages = [
|
||||||
|
pkgs.lua-language-server
|
||||||
|
];
|
||||||
|
|
||||||
plugins = [
|
plugins = [
|
||||||
vimPlugins.neodev-nvim
|
{
|
||||||
|
plugin = vimPlugins.neodev-nvim;
|
||||||
|
type = "lua";
|
||||||
|
config =
|
||||||
|
/*
|
||||||
|
lua
|
||||||
|
*/
|
||||||
|
''
|
||||||
|
-- IMPORTANT: make sure to setup neodev BEFORE lspconfig
|
||||||
|
require("neodev").setup({
|
||||||
|
override = function(root_dir, library)
|
||||||
|
if root_dir:find('${flakeEnv}', 1, true) == 1 then
|
||||||
|
library.enabled = true
|
||||||
|
library.plugins = true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
});
|
||||||
|
|
||||||
|
require('lspconfig').lua_ls.setup(
|
||||||
|
require('coq').lsp_ensure_capabilities({}));
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue