devos/users/modules/neovim/other_langs.nix

68 lines
1.9 KiB
Nix

{ lib, pkgs, config, ... }:
let
cfg = config.mae.nvim;
in
with lib;
{
imports = [
# Lua
({ ... }: {
options.mae.nvim.lua.enable = mkEnableOption "Enable lua support in nvim";
config.programs.neovim = mkIf cfg.lua.enable
{
coc.enable = true;
coc.settings.languageserver.lua = mkIf cfg.lua.enable {
command = "${pkgs.sumneko-lua-language-server}/bin/lua-language-server";
rootPatterns = [ ".git" ];
filetypes = [
"lua"
];
};
};
})
# Nix
({ ... }: {
options.mae.nvim.nix.enable = mkEnableOption "Enable nix support in nvim";
config.programs.neovim = mkIf cfg.nix.enable
{
plugins = with pkgs.vimPlugins; [
vim-nix
];
coc.enable = true;
coc.settings.languageserver.nix = mkIf cfg.nix.enable {
"command" = "${pkgs.rnix-lsp}/bin/rnix-lsp";
"filetypes" = [
"nix"
];
};
};
})
# Clangd
({ ... }: {
options.mae.nvim.clangd.enable = mkEnableOption "Enable clangd support in nvim";
config.programs.neovim = mkIf cfg.clangd.enable
{
plugins = with pkgs.vimPlugins; [
coc-clangd
];
coc.enable = true;
coc.settings = {
"clangd.checkUpdates" = false;
# Use whatever clangd is in path for dependency reasons I think I don't remember at this point
"clangd.path" = "clangd";
};
};
})
# Python
({ ... }: {
options.mae.nvim.python.enable = mkEnableOption "Enable python support in nvim";
config.programs.neovim = mkIf cfg.python.enable
{
coc.enable = true;
plugins = with pkgs.vimPlugins; [
coc-pyright
];
};
})
];
}