feat(nix): reorganize plugins in neovim package for nix

This commit is contained in:
Guz
2025-12-12 13:53:53 -03:00
parent 5c81a42ab9
commit 68560f5b9a

View File

@@ -2,63 +2,79 @@
pkgs, pkgs,
lib, lib,
neovim ? pkgs.neovim, neovim ? pkgs.neovim,
blink-cmp ? pkgs.vimPlugins.blink-cmp,
ripgrep ? pkgs.ripgrep,
mdfmt ? null, mdfmt ? null,
go-grip ? pkgs.go-grip,
yazi ? pkgs.yazi, yazi ? pkgs.yazi,
... ...
}: let }: let
start = dot-nvim = pkgs.vimUtils.buildVimPlugin {
(with pkgs.vimPlugins; [ name = "dot.nvim";
catppuccin-nvim src = lib.cleanSource ./.;
indent-blankline-nvim };
lze in
nvim-lspconfig neovim.override {
nvim-treesitter.withAllGrammars viAlias = true;
nvim-treesitter-textobjects vimAlias = true;
nvim-treesitter-textsubjects configure.packages.plugins = {
# Reference: ./lua/dot/plugins.lua
( start = with pkgs.vimPlugins; [
(pkgs.vimUtils.buildVimPlugin { lze
name = "dot013.nvim"; lzextras
src = ./.;
}).overrideAttrs # Language Server Protocol
{doCheck = false;} nvim-lspconfig
)
]) # Autocomplete
++ [
blink-cmp blink-cmp
friendly-snippets # Snippets
# Treesitter (Syntax Highlighting)
nvim-treesitter.withAllGrammars
nvim-treesitter-textobjects # Dependency
nvim-treesitter-textsubjects # Dependency
(dot-nvim.overrideAttrs {doCheck = false;})
]; ];
opt = with pkgs.vimPlugins; [ opt = with pkgs.vimPlugins; [
auto-save-nvim # Language Server Protocol
auto-session lazydev-nvim
cloak-nvim
conform-nvim
comment-nvim
friendly-snippets
gitsigns-nvim
harpoon2
lualine-nvim
luasnip
marks-nvim
nvim-autopairs
nvim-dap
nvim-dap-go
nvim-dap-ui
nvim-dap-virtual-text
nvim-nio
nvim-ts-autotag
nvim-web-devicons
tailwind-tools-nvim
telescope-nvim
telescope-zf-native-nvim
telescope-undo-nvim
todo-comments-nvim
trouble-nvim
tmux-nvim
vim-sleuth
# Debugger
nvim-dap
nvim-dap-ui
nvim-nio # Dependency
# Formatting
conform-nvim
guess-indent-nvim
# Fuzzy Finding
telescope-nvim
telescope-zf-native-nvim # Dependency
# Quick file switching
harpoon2
# Auto saving
auto-save-nvim
# Session restore
auto-session
# Secrets hiding
cloak-nvim
# Appearance
catppuccin-nvim
indent-blankline-nvim
# Git
gitsigns-nvim
# Todo Comments
todo-comments-nvim
# Integrations
(pkgs.vimUtils.buildVimPlugin { (pkgs.vimUtils.buildVimPlugin {
pname = "aw-watcher.nvim"; pname = "aw-watcher.nvim";
version = "master"; version = "master";
@@ -67,65 +83,59 @@
rev = "be7b03748f59b6602502baf08e7f7736cc7279a5"; rev = "be7b03748f59b6602502baf08e7f7736cc7279a5";
}; };
}) })
(pkgs.vimUtils.buildVimPlugin { (pkgs.vimUtils.buildVimPlugin {
pname = "nvim-emmet"; pname = "godot.nvim";
version = "v0.4.4"; version = "v0.4.4";
src = fetchGit { src = fetchGit {
url = "https://github.com/olrtg/nvim-emmet"; url = "https://github.com/Lommix/godot.nvim";
rev = "cde4fb2968704aae5c18b7f8a9bc2508767bb78d"; rev = "349b6b088c15447843fc21b60ba7267b8b49d821";
};
})
# Probably can be replaced by local functions in the config
(pkgs.vimUtils.buildVimPlugin {
pname = "tfm.nvim";
version = "2024-04-23";
src = fetchGit {
url = "https://github.com/Rolv-Apneseth/tfm.nvim";
rev = "fb0de2c96bf303216ac5d91ce9bdb7f430030f8b";
}; };
}) })
]; ];
# inherit start opt;
};
extraMakeWrapperArgs = let
binPath = lib.makeBinPath (with pkgs;
[
# INFO: LSP Providers
# Reference: ./lua/dot/lsp.lua
vscode-langservers-extracted # cssls, eslint, html, jsonls, typescript
languageServers = with pkgs; [
emmet-language-server emmet-language-server
deno
gopls
golangci-lint-langserver golangci-lint-langserver
gopls
htmx-lsp htmx-lsp
lemminx lemminx
lua-language-server lua-language-server
nil
marksman marksman
tailwindcss-language-server nil
typescript-language-server
rust-analyzer rust-analyzer
vscode-langservers-extracted tailwindcss-language-server
]; ]
++ [
# INFO: Formatters
# Reference: ./lua/dot/formatting.lua
# TODO: Remove some formatters from Neovim's path and let them be provided
# by flake.nix in projects
formatters = with pkgs; [
alejandra alejandra
jq gdtoolkit_4
html-tidy html-tidy
jq
libxml2 libxml2
mdfmt mdfmt
prettierd prettierd
shellharden shellharden
shfmt shfmt
]; ]
++ [
# INFO: External dependencies
externalDependencies = [ go-grip # Reference: ./lua/dot/commands.lua#Grip markdown reader
ripgrep yazi # Reference ./lua/dot/commands.lua#Yazi file manager
go-grip zf # Reference ./lua/dot/plugins.lua#telescope-zf-native.nvim
yazi ]);
];
in
neovim.override {
viAlias = true;
vimAlias = true;
configure.packages.plugins = {inherit start opt;};
extraMakeWrapperArgs = let
binPath = lib.makeBinPath (languageServers ++ formatters ++ externalDependencies);
in "--suffix PATH : ${binPath}"; in "--suffix PATH : ${binPath}";
} }