Nixvim addresses a familiar problem for Neovim users: managing complex plugin configurations in a way that’s reproducible, performant, and flexible. By leveraging Nix’s declarative system configuration capabilities combined with Lua code generation, Nixvim provides a unique approach to taming Neovim’s growing ecosystem of Lua-based plugins. This repo is worth a look if you’ve ever struggled with the tradeoffs between declarative configs and dynamic Lua scripting in Neovim.
Nixvim as a declarative Neovim configuration system
At its core, Nixvim is a Neovim configuration framework built around Nix modules and distributed as a Nix flake. It provides a declarative way to configure both Neovim and its plugins by expressing plugin options as Nix attribute sets. These configurations are then compiled into efficient Lua code, which Neovim consumes directly.
The architecture leans heavily on Nix’s strengths: reproducibility, atomic configuration, and integration with system-level package management. Nixvim fits naturally with Home Manager, NixOS, and nix-darwin, making it easy to integrate Neovim configuration into your broader system management.
Under the hood, the system disables all features by default to keep startup times low. Users explicitly enable plugins and options they want, which Nixvim then translates into a fast Lua configuration. This approach also makes the configuration highly granular and easy to audit.
How nixvim bridges declarative and dynamic plugin configuration
What sets Nixvim apart is its careful handling of plugin settings through the settings option. Typically, Neovim plugins require Lua tables for configuration, which can be difficult to express declaratively. Nixvim solves this by converting Nix attribute sets into Lua tables automatically.
Moreover, it supports a { __raw = "lua code"; } pattern that lets users inject arbitrary Lua snippets directly into the generated configuration. This design addresses a common limitation in declarative systems where some plugin setups require dynamic code or API calls that can’t be expressed purely as data.
This hybrid approach offers a flexible tradeoff: you get the benefits of declarative reproducibility and version control with Nix, but retain the ability to customize plugins dynamically where needed. The codebase responsible for this translation is surprisingly clean and well-documented, focusing on generating efficient Lua without unnecessary overhead.
The integration with flakes means you can pin exact versions of nixpkgs and nixvim itself, ensuring that your Neovim environment is reproducible down to the last dependency.
Installation and quickstart for nixvim
Here is how the README guides installation:
## Installation
> [!WARNING]
> Nixvim needs to be installed with a compatible nixpkgs version.
> This means that the `main` branch of Nixvim requires to be installed with `nixpkgs-unstable`.
>
> If you want to use Nixvim with nixpkgs 25.11 you should use the `nixos-25.11` branch.
For more detail, see the Installation section of our documentation.
<strong>Without flakes</strong>
Nixvim now ships with `flake-compat`, which makes it usable from any system.
To install it, edit your Home Manager, NixOS or nix-darwin configuration:
```nix
{ pkgs, lib, ... }:
let
nixvim = import (builtins.fetchGit {
url = "https://github.com/nix-community/nixvim";
# If you are not running an unstable channel of nixpkgs, select the corresponding branch of Nixvim.
# ref = "nixos-25.11";
});
in
{
imports = [
# For Home Manager
nixvim.homeModules.nixvim
# For NixOS
nixvim.nixosModules.nixvim
# For nix-darwin
nixvim.nixDarwinModules.nixvim
];
programs.nixvim.enable = true;
}
Using flakes
This is the recommended method if you are already using flakes to manage your
system. To enable flakes, add this to /etc/nixos/configuration.nix
{ pkgs, lib, ... }:
{
nix = {
settings.experimental-features = [ "nix-command" "flakes" ];
};
}
Now, you need to import the module. If your system is already configured using
flakes, just add the nixvim input:
{
# ...
inputs.nixvim = {
url = "github:nix-community/nixvim";
# If you are not running an unstable channel of nixpkgs, select the corresponding branch of Nixvim.
# url = "github:nix-community/nixvim/nixos-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
}
You can now access the module using inputs.nixvim.homeModules.nixvim,
for a Home Manager installation, inputs.nixvim.nixosModules.nixvim, for NixOS,
and inputs.nixvim.nixDarwinModules.nixvim for nix-darwin.
## Verdict: who should consider nixvim?
Nixvim is most relevant for users who are already embedded in the Nix ecosystem and want a reproducible, declarative way to manage their Neovim configurations alongside their system. Its hybrid approach to plugin settings, blending declarative Nix attributes with raw Lua injection, offers a flexible balance few other tools provide.
The tradeoff is the learning curve: understanding Nix, flakes, and how Lua is generated can be demanding. It's not for someone looking for a quick, out-of-the-box Neovim config. But if you value reproducibility, single-source-of-truth configurations, and tight integration with NixOS or Home Manager, nixvim is a solid choice.
Performance-wise, the default-disabled approach ensures minimal startup overhead, which is a nice touch for users sensitive to Neovim's load times.
Overall, nixvim solves a real problem in the intersection of declarative system configuration and dynamic plugin ecosystems, and it's worth exploring if you fit the use case.
## Related Articles
- [Browser Harness: a self-healing LLM agent for browser automation via Chrome DevTools](https://ramdi.fr/github-stars/browser-harness-a-self-healing-llm-agent-for-browser-automation-via-chrome-devtools/) — Browser Harness enables LLMs to automate browsers by dynamically generating helper functions using the Chrome DevTools P
- [PinchTab: Token-efficient Chrome automation for AI agents with Go](https://ramdi.fr/github-stars/pinchtab-token-efficient-chrome-automation-for-ai-agents-with-go/) — PinchTab is a Go HTTP server enabling AI agents to control Chrome instances efficiently by extracting structured text, c
- [Polaris: A provider-agnostic feature flag and config management tool in Go](https://ramdi.fr/github-stars/polaris-a-provider-agnostic-feature-flag-and-config-management-tool-in-go/) — Polaris is a Go library that abstracts feature flag and configuration management across providers via clean interfaces.
- [OpenAI Codex CLI: local-first AI coding assistant with ChatGPT integration](https://ramdi.fr/github-stars/openai-codex-cli-local-first-ai-coding-assistant-with-chatgpt-integration/) — OpenAI Codex CLI brings AI coding assistance local to your terminal, integrating with ChatGPT plans for powerful hybrid
- [Pathway LLM App: unified pipelines for scalable retrieval-augmented generation and AI search](https://ramdi.fr/github-stars/pathway-llm-app-unified-pipelines-for-scalable-retrieval-augmented-generation-and-ai-search/) — Pathway LLM App provides integrated pipelines for scalable RAG and AI search, combining vector and full-text indexing wi
---
**→ GitHub Repo:** [nix-community/nixvim](https://github.com/nix-community/nixvim) ⭐ 2,765 · Nix