1
0
Fork 0
dotfiles/programs/nvim/default.nix

160 lines
3.3 KiB
Nix

{ config, pkgs, ... }:
let
customPlugins = import ./plugins.nix { inherit pkgs; };
nvim-spell-directory = "${config.xdg.configHome}/nvim/spell";
in
{
programs.neovim = {
enable = true;
package = pkgs.neovim-nightly;
withNodeJs = false;
withRuby = false;
withPython3 = false;
extraConfig = ''
" Move these paths to the end of $PATH to prevent triggering the XCode CLI popup
let xcode_paths = [':/usr/local/bin:', ':/usr/bin:', ':/usr/sbin:', ':/bin:', ':/sbin:']
for xcode_path in xcode_paths
let $PATH = substitute($PATH, xcode_path, ":", "") . substitute(xcode_path, ":$", "", "")
endfor
lua << EOF
require('impatient')
require('nix_init')
EOF
'';
extraPackages = with pkgs; [
gcc
gnumake
git
nodejs-16_x
tree-sitter
ripgrep
# LSP
nodePackages.bash-language-server
nodePackages.dockerfile-language-server-nodejs
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
nodePackages.yaml-language-server
rnix-lsp
sqls
sumneko-lua-language-server
taplo-lsp
# LSP Tools
hadolint
shellcheck
shfmt
statix
];
plugins = (with customPlugins; [
# Fixes
impatient-nvim
# Utils
popup-nvim
plenary-nvim
nvim-web-devicons
# Keybindings
which-key-nvim
{ plugin = vim-yoink; optional = true; }
{ plugin = vim-cutlass; optional = true; }
{ plugin = vim-subversive; optional = true; }
leap-nvim
# Themes
dracula-nvim
# Syntax
nvim-treesitter
playground
# Telescope
telescope-nvim
telescope-zf-native-nvim
telescope-ui-select-nvim
project-nvim
todo-comments-nvim
# LSP
nvim-lspconfig
null-ls-nvim
trouble-nvim
lspkind-nvim
virtual-types-nvim
lsp-status-nvim
vim-illuminate
# cmp
nvim-cmp
cmp-nvim-lsp
cmp-nvim-lsp-signature-help
LuaSnip
cmp_luasnip
cmp-nvim-lua
cmp-path
cmp-buffer
cmp-treesitter
cmp-cmdline
cmp-nvim-lsp-document-symbol
# Pairs
nvim-autopairs
nvim-ts-autotag
vim-matchup
# Comments
Comment-nvim
# Textobjects
nvim-treesitter-textobjects
# UI
lualine-nvim
bufferline-nvim
nvim-tree-lua
indent-blankline-nvim
virt-column-nvim
neogit
gitsigns-nvim
spellsitter-nvim
nvim-notify
nvim-visual-eof-lua
FTerm-nvim
]) ++ (with pkgs.vimPlugins; [
# Fixes
FixCursorHold-nvim
# Textobjects
vim-surround
# UI
undotree
]);
};
xdg.configFile.nvim = {
source = ../../config/nvim;
recursive = true;
};
home.file."${nvim-spell-directory}/de.utf-8.spl".source = builtins.fetchurl {
url = "http://ftp.vim.org/pub/vim/runtime/spell/de.utf-8.spl";
sha256 = "73c7107ea339856cdbe921deb92a45939c4de6eb9c07261da1b9dd19f683a3d1";
};
home.file."${nvim-spell-directory}/de.utf-8.sug".source = builtins.fetchurl {
url = "http://ftp.vim.org/pub/vim/runtime/spell/de.utf-8.sug";
sha256 = "13d0ecf92863d89ef60cd4a8a5eb2a5a13a0e8f9ba8d1c6abe47aba85714a948";
};
home.sessionVariables.EDITOR = "nvim";
}