From f7a6fa7fcc68891a3cc7d74958dfbfc45a1385b9 Mon Sep 17 00:00:00 2001 From: kalle Date: Tue, 18 Aug 2026 16:54:56 +0200 Subject: [PATCH] perf: cut nixvim build time plugins.treesitter.grammarPackages defaulted to every grammar nvim-treesitter ships (~350), forcing ~340 uncached nvim-treesitter-queries-* derivations to build locally on every run. Pin an explicit 23-language list instead. Also disable enableMan (renders the full nixvim option reference via options.json + nixos-render-docs on every build) and drop openscad, which pulled in openscad, zathura + plugins, mupdf and texlive-bin. Cold-store build plan: 370 -> ~54 derivations built, 1095 -> ~285 paths fetched (418 -> ~226 MiB). Co-Authored-By: Claude Opus 5 (1M context) --- config/default.nix | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/config/default.nix b/config/default.nix index 9c914c3..8a32457 100644 --- a/config/default.nix +++ b/config/default.nix @@ -1,6 +1,11 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: { + # Skip generating the nixvim options manpage. It renders the *entire* nixvim + # option reference on every build (options.json + nixos-render-docs + a Python + # env) and is pure build-time cost — `:help nixvim` is the only thing lost. + enableMan = false; + # Extra packages available in Neovim's PATH extraPackages = with pkgs; [ ripgrep # Required by Telescope and fzf-lua for fast file content searching (grep) @@ -35,8 +40,38 @@ # Sidebar file explorer for visual project navigation and file management nvim-tree.enable = true; - # Syntax-aware highlighting, indentation, and code folding via incremental parsing - treesitter.enable = true; + # Syntax-aware highlighting, indentation, and code folding via incremental parsing. + # grammarPackages defaults to *every* grammar nvim-treesitter ships (~350), + # which forces ~340 query derivations to be built locally and pulls hundreds + # of MiB of parsers. Pin an explicit list instead — add languages as needed. + treesitter = { + enable = true; + grammarPackages = with config.plugins.treesitter.package.builtGrammars; [ + bash + c + css + diff + dockerfile + git_rebase + gitcommit + html + javascript + json + lua + make + markdown + markdown_inline + nix + python + query + regex + toml + typescript + vim + vimdoc + yaml + ]; + }; # Git integration directly in the command line (:Git blame, :Git diff, :Git log, etc.) fugitive.enable = true; @@ -47,9 +82,6 @@ # Popup that shows available keybindings as you type — great for discovering and remembering mappings which-key.enable = true; - # Syntax highlighting and preview support for OpenSCAD 3D modeling files - openscad.enable = true; - # Full-featured git UI inside a floating terminal — staging, committing, branching made visual lazygit.enable = true;