nix/modules/home/programs/neovim/default.nix

127 lines
2.6 KiB
Nix
Raw Normal View History

2024-03-09 17:18:36 +01:00
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
home.packages = with pkgs; [
ripgrep
marksman
wl-clipboard
];
programs.neovim =
let
toLua = str: "lua << EOF\n${str}\nEOF\n";
toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
in
{
enable = true;
coc = {
enable = false;
settings = {
languageserver = {
arduino = {
command = ["steam-run" "arduino-language-server"];
rootPatterns = ["*.ino"];
filetypes = ["arduino"];
args = ["-cli" "steam-run" "arduino-cli" "-clangd" "steam-run" "clangd" "-cli-config" "/home/xeovalyte/.arduino15/arduino-cli.yaml"];
};
};
};
};
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraLuaConfig = ''
${builtins.readFile ./options.lua}
${builtins.readFile ./keymaps.lua}
${builtins.readFile ./autocmd.lua}
'';
plugins = with pkgs.vimPlugins; [
nvim-web-devicons
{
plugin = nvim-autopairs;
config = toLua "require(\"nvim-autopairs\").setup{}";
}
{
plugin = telescope-nvim;
}
plenary-nvim
{
plugin = nvim-lspconfig;
config = toLuaFile ./plugins/lsp.lua;
}
neodev-nvim
mason-nvim
mason-lspconfig-nvim
which-key-nvim
rustaceanvim
lsp-inlayhints-nvim
nvim-dap
{
plugin = markdown-preview-nvim;
config = toLuaFile ./plugins/markdown-preview.lua;
}
{
plugin = nvim-cmp;
config = toLuaFile ./plugins/cmp.lua;
}
cmp_luasnip
cmp-nvim-lsp
luasnip
friendly-snippets
{
plugin = nvim-tree-lua;
config = toLuaFile ./plugins/nvim-tree.lua;
}
{
plugin = toggleterm-nvim;
config = toLuaFile ./plugins/toggleterm.lua;
}
{
plugin = (nvim-treesitter.withPlugins (p: [
p.tree-sitter-nix
p.tree-sitter-bash
p.tree-sitter-json
p.tree-sitter-rust
p.tree-sitter-vue
p.tree-sitter-arduino
p.tree-sitter-html
p.tree-sitter-css
p.tree-sitter-javascript
]));
config = toLuaFile ./plugins/treesitter.lua;
}
{
plugin = onedark-nvim;
config = toLuaFile ./colorscheme.lua;
}
{
plugin = presence-nvim;
config = toLua "require(\"presence\").setup()";
}
{
plugin = bufferline-nvim;
config = toLuaFile ./plugins/bufferline.lua;
}
];
};
}