Description
Problem
I'm a new NixVim user, previously I was symlinking my ~/.config/nvim
with NixOS/home-manager. After changing a lua file and restarting neovim, it was immediately applied.
With NixVim, it takes 31s on my machine to build the (standalone) package after changing some configuration, when experimenting with new plugins, this gets rather frustrating very quickly.
Out of that 31s, ~15s were spent on evaluating Nix code, 14s spent on building the wrapped Neovim package, and the rest ~2s was spent on some minor things.
Improvement: skip fixup phase
We can get rid of most of the time spent on building the wrapped Neovim package by skipping the fixup phase, for me this improves the overall build time from 31s to 18s (-42% !)
For just testing the changes, I didn't see any downsides with that, AFAIK it skips shrinking, stripping, running autoPatchELF, patching shebangs, gzipping man pages, auditing tmpdir, separating debug info and updating some autootols config.
After some reverse engineering I got to this implementation: gepbird/nvim@6e7420f. It overrides wrapNeovimUnstable
to skip the fixup phase in the wrapper derivation, and passes this patched pkgs
to NixVim.
Improvement: removing extra derivations
Adding a simple enableMan = false;
NixVim config improves the eval time from 13.5s to 6.6s, and removing printInitPackage
decreases it to 5.5s. With all of these changes, the overall build time is 11.5s.
Alternative solution
With impureRtp, I could do the experimenting part in ~/.config/nvim
and when I'm done rewrite it in NixVim but I'm not a big fan of this workflow.