nixos-config/users/simon/modules/neovim/default.nix

136 lines
3.3 KiB
Nix
Raw Normal View History

{ config, lib, nixosConfig, pkgs, ... }:
2020-11-07 16:58:18 +01:00
let
2021-12-01 18:24:04 +01:00
rainbow_csv = pkgs.vimUtils.buildVimPluginFrom2Nix rec {
2020-11-07 16:58:18 +01:00
name = "rainbow_csv";
src = pkgs.fetchFromGitHub {
owner = "mechatroner";
repo = name;
rev = "df89266d6c03479def77793fd7a0a651986865a5";
sha256 = "0c9b1r49vw6r3yhm6g02janyxw6d9j6bkjmv8zpdav46avmk74fh";
};
2021-01-03 13:46:38 +01:00
meta.license = lib.licenses.mit;
2020-11-07 16:58:18 +01:00
};
2021-12-01 18:24:04 +01:00
vim-openscad = pkgs.vimUtils.buildVimPluginFrom2Nix rec {
2020-11-07 16:58:18 +01:00
name = "vim-openscad";
src = pkgs.fetchFromGitHub {
owner = "sirtaj";
repo = name;
rev = "81db508b1888fdbea994d43ccef1acd86c8af3f7";
sha256 = "1wcdfayjpb9h0lzwdi5nda4c0ch263fdr0379l9k1gf47bgq9cx2";
};
2021-01-03 13:46:38 +01:00
meta.license = lib.licenses.publicDomain;
2020-11-07 16:58:18 +01:00
};
2021-12-01 18:24:04 +01:00
Vim-Jinja2-Syntax = pkgs.vimUtils.buildVimPluginFrom2Nix rec {
2020-11-07 16:58:18 +01:00
name = "Vim-Jinja2-Syntax";
src = pkgs.fetchFromGitHub {
owner = "Glench";
repo = name;
rev = "5d2496eb5fd4415c7ce062ccbcd53a3f0de93aa3";
sha256 = "1ss065b2psalli46bs3v13fhaplqydh13bg3jg3zr98wbdn70cws";
};
2021-01-03 13:46:38 +01:00
meta.license = lib.licenses.bsd3;
2020-11-07 16:58:18 +01:00
};
in
{
programs.neovim = {
enable = true;
2021-12-01 18:24:04 +01:00
package = pkgs.neovim-unwrapped;
2020-11-07 19:14:21 +01:00
vimAlias = true;
extraConfig = ''
lua require('init')
2020-11-07 16:58:18 +01:00
'';
extraPackages = with pkgs; [
unzip # zip.vim
] ++ (lib.optionals nixosConfig.sbruder.full [
gopls
haskell-language-server
rnix-lsp
rust-analyzer
2022-12-10 17:16:34 +01:00
(python3.withPackages (ps: with ps; [
pyls-isort
2022-12-10 17:16:34 +01:00
pylsp-mypy
python-lsp-black
python-lsp-server
2022-12-10 17:16:34 +01:00
# pylsp optional dependencies
flake8
mccabe
pycodestyle
pydocstyle
pyflakes
pylint
]))
nodePackages."@tailwindcss/language-server"
universal-ctags
]);
2021-12-01 18:24:04 +01:00
plugins = with pkgs.vimPlugins; [
2020-11-07 16:58:18 +01:00
Vim-Jinja2-Syntax
cmp-buffer
cmp-nvim-lsp
cmp-path
cmp_luasnip
diffview-nvim
editorconfig-nvim
friendly-snippets
gitsigns-nvim
lspkind-nvim
lualine-lsp-progress
lualine-nvim
luasnip
neogit
nvim-cmp
nvim-lspconfig
2022-12-10 17:16:34 +01:00
nvim-solarized-lua
2022-06-12 22:45:15 +02:00
nvim-treesitter
nvim-web-devicons
plenary-nvim
2020-11-07 16:58:18 +01:00
rainbow_csv
rust-vim
tagbar
telescope-nvim
2022-12-10 17:16:34 +01:00
telescope-ui-select-nvim
trouble-nvim
vim-fugitive
2022-06-12 22:34:27 +02:00
vim-illuminate
vim-markdown
vim-nix
2020-11-07 16:58:18 +01:00
vim-openscad
vim-snippets
vimtex
which-key-nvim
2020-11-07 16:58:18 +01:00
];
};
xdg.configFile = {
"nvim/lua/init.lua".source = ./init.lua;
"nvim/lua/snippets.lua".source = pkgs.callPackage ./snippets.nix { };
2022-06-12 22:44:55 +02:00
} // (lib.mapAttrs'
(name: path: lib.nameValuePair "nvim/parser/${lib.removePrefix "tree-sitter-" name}.so" { source = "${path}/parser"; })
({
inherit (pkgs.tree-sitter.builtGrammars)
#tree-sitter-bash
2022-06-12 22:44:55 +02:00
tree-sitter-c
tree-sitter-cpp
tree-sitter-css
tree-sitter-dot
tree-sitter-go
tree-sitter-haskell
tree-sitter-html
tree-sitter-json
#tree-sitter-latex # incompatible with VimTeX
tree-sitter-lua
tree-sitter-nix
tree-sitter-perl
tree-sitter-python
tree-sitter-rust
tree-sitter-scss
tree-sitter-toml
tree-sitter-yaml;
}));
2021-03-01 18:40:07 +01:00
home.sessionVariables.EDITOR = "nvim";
2020-11-07 16:58:18 +01:00
}