parent
83bc927a8d
commit
4d6a733a6e
4 changed files with 45 additions and 0 deletions
homeManagerModules/neovim/langs/golang
39
homeManagerModules/neovim/langs/golang/default.nix
Normal file
39
homeManagerModules/neovim/langs/golang/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.ideConfig.enableGolang) {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = with pkgs; [go gopls];
|
||||
|
||||
plugins = [
|
||||
{
|
||||
plugin = pkgs.vimPlugins.clangd_extensions-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
local lsp = require('lspconfig');
|
||||
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
||||
|
||||
lsp.gopls.setup({
|
||||
cmd = { '${pkgs.gopls}/bin/gopls' },
|
||||
capabilities = default_capabilities,
|
||||
});
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# For accurate stack trace
|
||||
_file = ./default.nix;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue