Uses Neovim 0.11+ built-in LSP API (vim.lsp.config + vim.lsp.enable). No nvim-lspconfig plugin needed.
| Server | Binary | Filetypes | Root Markers |
|---|---|---|---|
| lua_ls | lua-language-server |
lua | .luarc.json, .luarc.jsonc, .git |
| nil_ls | nil |
nix | flake.nix, .git |
| rust_analyzer | rust-analyzer |
rust | Cargo.toml, .git |
| pylsp | pylsp |
python | pyproject.toml, setup.py, setup.cfg, requirements.txt, .git |
All servers share a wildcard config that sets .git as a fallback root marker and registers blink.cmp completion capabilities.
lua_ls: Runtime set to LuaJIT, workspace includes Neovim runtime files (enables completion for vim.* APIs), telemetry disabled.
nil_ls: Uses nixpkgs-fmt as the Nix formatter.
rust_analyzer: Minimal config — relies on rust-analyzer defaults and Cargo.toml for project settings.
pylsp: Minimal config — uses whatever pylsp is on PATH. Intended to come from each project's dev environment (nix develop / devenv), not from system packages.
Most LSP binaries come from NixOS packages — no Mason needed. They are declared in modules/programs/dev-tools.nix in the parent NixOS config. The exception is pylsp, which comes from each Python project's dev environment (e.g., nix develop or devenv shell). Run :checkhealth utils to verify they're on PATH.
The wildcard config calls require("blink.cmp").get_lsp_capabilities() to register completion capabilities with every server. This is why lsp/init.lua must load after lazy.setup("plugins") in the init.lua boot sequence.
Shows which LSP servers are attached to the current buffer and their workspace root directories.
LSP [lua_ls] root: /home/anoni/.nixos/dotfiles/nvim-nightly
Opens the Neovim LSP log file in a horizontal split. Useful for seeing raw server communication.
Toggles the LSP log level between WARN (default) and DEBUG. When DEBUG is active, the LSP log captures all request/response traffic — use :LspLog to view it.
:LspDebug " -> "LSP log level: DEBUG"
:LspDebug " -> "LSP log level: WARN"
-
Add the server binary to your NixOS config (
modules/programs/dev-tools.nix) -
Add a config block to
lua/lsp/init.lua:vim.lsp.config("server_name", { cmd = { "binary-name" }, filetypes = { "filetype" }, root_markers = { "project-file", ".git" }, })
-
Add the server name to the
vim.lsp.enable()call:vim.lsp.enable({ "lua_ls", "nil_ls", "rust_analyzer", "pylsp", "server_name" })
-
Add the binary to the health check in
lua/utils/health.lua:{ "binary-name", "Language LSP" }, -
Rebuild NixOS:
sudo nixos-rebuild switch --flake .#mouse -
Verify: open a file of the target filetype, run
:LspStatus