Add an nvim Module that configures Neovim declaratively through nixvim, wired as a flake input and consumed as its home-manager module. Options, globals, keymaps, and plugin settings are typed Nix; the colorscheme call and two autocmds live in modules/nvim/config.lua via extraConfigLua. Plugins come from nixpkgs (no plugin manager, no runtime cloning); git, ripgrep, and fd are provided from Nix; treesitter grammars are built by Nix so no runtime compiler is needed. Functionally matches the previous config (plugins, keymaps, options, the nord colorscheme, markdown conceal, the Neogit blame toggle), verified headless against the generated init.
2.7 KiB
2.7 KiB
spec, blocked-by
| spec | blocked-by |
|---|---|
| laptop-mvi | 0001-skeleton-and-building-host |
What to build
An nvim Module that gives the primary user Neovim configured declaratively through nixvim, with functional parity to the operator's existing config.
Parity is about the "what" — the same plugins, keymaps, options, colorscheme, and behaviour — not the "how".
The mechanism is deliberately free to follow NixOS's declarative paradigm rather than transplanting the imperative lazy.nvim setup: plugins are managed by Nix (no plugin manager, no runtime cloning, no lockfile), and as much of the config as possible is expressed as typed Nix, with raw Lua kept only as an escape hatch.
Acceptance criteria
- An nvim
Module(following theEnable convention) is enabled onneogaia. - Neovim is configured via nixvim, wired as a flake input (
nixvim.inputs.nixpkgs.follows = "nixpkgs"), consumed as its home-manager module underhome-manager.users.<user>.programs.nixvim. - Functional parity with the previous config: the same plugins (neogit, diffview, gitsigns, oil, snacks, gbprod-nord, render-markdown, which-key, treesitter), keymaps,
vimoptions, thenordcolorscheme, the Neogit blame-toggle autocmd, and markdown concealment — verified headless against the generated config. - Runtime dependencies
git,ripgrep, andfdare provided by Nix;gccis not needed because Nix builds the treesitter grammars. - The
neogaiatoplevel still builds with the nvimModuleenabled.
Implementation Notes
- nixvim, typed Nix first.
modules/nvim/nvim.nixenablesprograms.nixvimwithopts,globals,keymaps, and typedplugins.*settings. Treesitter usesplugins.treesitter(highlight.enable,indent.enable,grammarPackagesfrom the module's ownbuiltGrammars) covering nix, lua, bash, fish, markdown, rust, python, java, kotlin, c, cpp, html, css, javascript, typescript, go. - The imperative remainder — the
gbprod/nord.nvimsetup + colorscheme call, the markdownconceallevelautocmd, and the Neogit blame-toggleBufUnloadautocmd — lives inmodules/nvim/config.lua, pulled in viaextraConfigLua = builtins.readFile ./config.lua.gbprod-nordcomes in throughextraPluginsbecause nixvim'scolorschemes.nordis a different plugin. - Verification.
nix build .#…programs.nixvim.build.packageexits 0 and the whole toplevel evaluates. The generated config was exercised headless (launched with-uthe generated init and a scratchHOME, since the wrapper otherwise loads the dev host's real~/.config/nvim): all options, keymaps, plugins, thenordcolorscheme, treesitter highlight + indent, and markdown conceal load with no errors.