{ config, pkgs, lib, my, ... }: let treesitterParsers = pkgs.symlinkJoin { name = "treesitter-parsers"; paths = builtins.attrValues pkgs.vimPlugins.nvim-treesitter.passthru.grammarPlugins; }; in { programs.neovim = { enable = true; defaultEditor = true; viAlias = true; vimAlias = true; withNodeJs = true; withPython3 = true; extraPackages = with pkgs; [ # Native compilation tools & Treesitter CLI gcc clang gnumake cmake tree-sitter # Search & Fuzzy Finding ripgrep fd fzf # Archive and Network Utilities git curl unzip gnutar gzip # Language Servers, Linters & Formatters (Declarative, no Mason needed) # Nix nil nixfmt statix # Lua lua-language-server stylua # C / C++ llvmPackages_latest.clang-tools llvmPackages_latest.lldb # Rust rust-analyzer # Python pyright ruff # Web / TypeScript / JavaScript / HTML / CSS / JSON vtsls vscode-langservers-extracted prettier # Shell shfmt shellcheck ]; extraWrapperArgs = [ "--set" "NVIM_TREESITTER_PARSERS" "${treesitterParsers}" ]; }; # Live LazyVim config symlinked straight from the repo: edits (and # `:Lazy update` writes to lazy-lock.json) apply without a rebuild. xdg.configFile."nvim/init.lua".source = config.lib.file.mkOutOfStoreSymlink "${my.flakeDir}/home/nvim/config/init.lua"; xdg.configFile."nvim/lua".source = config.lib.file.mkOutOfStoreSymlink "${my.flakeDir}/home/nvim/config/lua"; xdg.configFile."nvim/lazy-lock.json".source = config.lib.file.mkOutOfStoreSymlink "${my.flakeDir}/home/nvim/config/lazy-lock.json"; # Symlink precompiled Treesitter parsers directly into ~/.config/nvim/parser xdg.configFile."nvim/parser".source = "${treesitterParsers}/parser"; }