No description
Find a file
nixvim-ci[bot] 4fd45857de flake: Update
flake.lock updates:
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/6edbf1a6a03e75886a6609c088801a0856449e88?narHash=sha256-0lkauQbtrljJqwtzTCILPAiHAJyMvn6XDo264moDv30%3D' (2026-07-05)
  → 'github:NixOS/nixpkgs/f205b5574fd0cb7da5b702a2da51507b7f4fdd1b?narHash=sha256-/NAkDSsve%2BGNM0Bt6tleJdCGfsTlK89nPjkVOzZMo0s%3D' (2026-07-05)

flake/dev/flake.lock updates:
• Updated input 'nixvim':
    'path:../..'
  → 'path:../..'
• Updated input 'nixvim/nixpkgs':
    'github:NixOS/nixpkgs/6edbf1a6a03e75886a6609c088801a0856449e88?narHash=sha256-0lkauQbtrljJqwtzTCILPAiHAJyMvn6XDo264moDv30%3D' (2026-07-05)
  → 'github:NixOS/nixpkgs/f205b5574fd0cb7da5b702a2da51507b7f4fdd1b?narHash=sha256-/NAkDSsve%2BGNM0Bt6tleJdCGfsTlK89nPjkVOzZMo0s%3D' (2026-07-05)
2026-07-06 14:58:51 +00:00
.github ci/backport: specify workflows permission 2026-07-01 15:26:03 +00:00
assets docs(readme): improve logo quality (#830) 2023-12-21 20:01:44 +01:00
ci ci/version-info: reformat 2026-06-02 17:33:26 +00:00
colorschemes colorschemes/modus: replace deprecated variant option 2026-04-09 22:47:18 +00:00
docs docs/user-configs: update carl0xs url 2026-07-06 14:40:11 +00:00
flake flake: Update 2026-07-06 14:58:51 +00:00
generated generated: Updated lint-linters.json 2026-07-02 16:10:29 +00:00
lib lib/keymaps: remove lua submodule option 2026-06-12 18:04:20 +00:00
modules modules/opts: docs on difference between opts, global opts and local opts 2026-07-06 14:40:11 +00:00
plugins treewide: elixir -> beamPackages.elixir 2026-07-02 16:10:29 +00:00
templates templates/simple: add README link to docs 2026-06-07 12:49:05 +00:00
tests tests/platforms/darwin: disable docs 2026-07-05 14:56:14 +00:00
wrappers wrappers: inherit platform config tuples 2026-06-29 04:20:49 +00:00
.editorconfig editorconfig: set root 2025-07-29 16:13:15 +00:00
.envrc envrc: nix-direnv 2.3.0 → 3.1.0 2025-09-26 21:46:46 +00:00
.git-blame-ignore-revs .git-blame-ignore-revs: init 2024-06-05 09:09:07 +01:00
.gitignore gitignore: add templates/_wrapper/simple/flake.lock 2023-12-08 16:12:42 +01:00
.mailmap mailmap: map NAHO developer identity to Noah Biewesch 2026-05-16 00:39:36 +00:00
CONTRIBUTING.md contributing: fix table breaking syntax 2026-05-20 19:49:47 +00:00
default.nix flake: migrate flake-compat input to NixOS organization 2025-10-28 10:03:02 +00:00
example.nix treewide: NixVim/nixvim -> Nixvim 2025-12-04 23:22:21 +00:00
flake.lock flake: Update 2026-07-06 14:58:51 +00:00
flake.nix flake: pin systems to future-26.11 2026-05-29 16:57:17 +00:00
LICENSE license: update copyright year 2026-01-08 21:09:06 +00:00
MAINTAINING.md treewide: bump stable 25.11 → 26.05 2026-06-07 20:52:06 +00:00
nixbot.toml ci: buildbot-nix → nixbot 2026-07-02 13:52:50 +00:00
nixpkgs.nix nixpkgs: add file that fetches pinned revision 2026-05-24 03:05:36 +00:00
README.md treewide: bump stable 25.11 → 26.05 2026-06-07 20:52:06 +00:00
typos.toml modules/lsp: move packages.nix from plugins.lsp 2025-12-13 17:19:54 +00:00
version-info.toml flake: Update 2026-07-06 14:58:51 +00:00

Documentation | Chat

Nixvim - A Neovim configuration system for nix

What is it?

Nixvim is a Neovim distribution built around Nix modules. It is distributed as a Nix flake, and configured through Nix, all while leaving room for your plugins and your vimrc.

What does it look like?

Here is a simple configuration that uses catppuccin as the colorscheme and uses the lualine plugin:

{
  programs.nixvim = {
    enable = true;

    colorschemes.catppuccin.enable = true;
    plugins.lualine.enable = true;
  };
}

When we do this, lualine will be set up to a sensible default, and will use catppuccin as the colorscheme, no extra configuration required!

Check out this list of real world Nixvim configs!

How does it work?

When you build the module (probably using Home Manager), it will install all your plugins and generate a lua config for Neovim with all the options specified. Because it uses lua, this ensures that your configuration will load as fast as possible.

Since everything is disabled by default, it will be as snappy as you want it to be.

Plugin settings

Most plugins have a settings option, which accepts any nix attribute set and translate it into a lua table. This is then passed to the plugin's setup function. In practice this means if a plugin has a settings option, any plugin option can be configured, even if we don't explicitly have a corresponding nix option.

Raw lua

If you just want to add additional lines of lua to your init.lua, you can use extraConfigLua, extraConfigLuaPre, and extraConfigLuaPost.

If you want to assign lua code to an option that'd normally accept another type (string, int, etc), you can use Nixvim's "raw type", { __raw = "lua code"; }.

Example

This nix code:

{
  some_option.__raw = "function() print('hello, world!') end";
}

Will produce the following lua:

{
  ['some_option'] = function() print('hello, world!') end,
}

Support/Questions

If you have any question, please use the discussions page! Alternatively, join the Matrix channel at #nixvim:matrix.org!

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 26.05 you should use the nixos-26.05 branch.

For more detail, see the Installation section of our documentation.

Without flakes

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:

{ 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-26.05";
  });
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-26.05";

    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.

Usage

Nixvim can be used in four ways: through the Home Manager, nix-darwin, NixOS modules, and standalone through the makeNixvim function. To use the modules, just import the nixvim.homeModules.nixvim, nixvim.nixDarwinModules.nixvim, and nixvim.nixosModules.nixvim modules, depending on which system you're using.

For more detail, see the Usage section of our documentation.

Standalone Usage

Nixvim can also be used separately from NixOS, Home Manager, etc. To use Nixvim standalone, evaluate a Nixvim configuration and use its package output:

let
  nixvim = import (builtins.fetchTarball {
    # ...
  });
  configuration = nixvim.lib.evalNixvim {
    system = builtins.currentSystem;

    modules = [
      {
        colorschemes.gruvbox.enable = true;
      }
    ];
  };
in
configuration.config.build.package

The configuration also exposes a test derivation through configuration.config.build.test, which can be used from checks.

To get started with a standalone configuration, you can use the template by running the following command in an empty directory (recommended):

nix flake init --template github:nix-community/nixvim

Alternatively, you can create a minimal flake:

Minimal flake configuration
{
  description = "A very basic flake";

  inputs = {
    nixpkgs.follows = "nixvim/nixpkgs";
    nixvim.url = "github:nix-community/nixvim";
  };

  outputs =
    { nixpkgs, nixvim, ... }:
    let
      systems = [
        "x86_64-linux"
        "aarch64-linux"
        "aarch64-darwin"
      ];

      forAllSystems = nixpkgs.lib.genAttrs systems;
    in
    {
      packages = forAllSystems (
        system:
        let
          configuration = nixvim.lib.evalNixvim {
            inherit system;

            modules = [
              {
                colorschemes.gruvbox.enable = true;
              }
            ];
          };
        in
        {
          default = configuration.config.build.package;
        }
      );
    };
}

You can then run Neovim using nix run .# -- <file>. This can be useful for testing configuration changes.

For more information, see the Standalone Usage docs.

Documentation

Documentation is available on this project's GitHub Pages page: https://nix-community.github.io/nixvim

The stable documentation is also available at https://nix-community.github.io/nixvim/26.05.

If the option enableMan is set to true (by default it is), man pages will also be installed containing the same information, they can be viewed with man nixvim.

Plugins

After you have installed Nixvim, you will no doubt want to enable some plugins. Plugins are based on a modules system, similarly to NixOS and Home Manager.

So, to enable some supported plugin, all you have to do is enable its module:

{
  programs.nixvim = {
    plugins.lightline.enable = true;
  };
}

Of course, if that was everything, there wouldn't be much point to Nixvim, you'd just use a regular plugin manager. All options for supported plugins are exposed as options of that module. For now, there is no documentation yet, but there are detailed explanations in the source code. Detailed documentation for every module is planned.

Not all plugins will have modules, so you might still want to fetch some. This is not a problem, just use the extraPlugins option:

{
  programs.nixvim = {
    extraPlugins = with pkgs.vimPlugins; [
      vim-nix
    ];
  };
}

However, if you find yourself doing this a lot, please consider contributing or requesting a module!

Colorschemes

Colorschemes are provided within a different scope:

{
  programs.nixvim = {
    # Enable gruvbox
    colorschemes.gruvbox.enable = true;
  };
}

Just like with normal plugins, extra colorscheme options are provided as part of its module.

If your colorscheme isn't provided as a module, install it using extraPlugins and set it using the colorscheme option:

{
  programs.nixvim = {
    extraPlugins = [ pkgs.vimPlugins.gruvbox ];
    colorscheme = "gruvbox";
  };
}

All Nixvim supported plugins will, by default, use the main colorscheme you set, though this can be overridden on a per-plugin basis.

Options

Neovim has a lot of configuration options. You can find a list of them by doing :h option-list from within Neovim.

All of these are configurable from within Nixvim. All you have to do is set the opts attribute:

{
  programs.nixvim = {
    opts = {
      number = true;         # Show line numbers
      relativenumber = true; # Show relative line numbers

      shiftwidth = 2;        # Tab width should be 2
    };
  };
}

Please note that to, for example, disable numbers you would not set opts.nonumber to true, you'd set opts.number to false.

Key mappings

It is fully possible to define key mappings from within Nixvim. This is done using the keymaps attribute:

{
  programs.nixvim = {
    keymaps = [
      {
        key = ";";
        action = ":";
      }
      {
        mode = "n";
        key = "<leader>m";
        options.silent = true;
        action = "<cmd>!make<CR>";
      }
    ];
  };
}

This is equivalent to this vimscript:

noremap ; :
nnoremap <leader>m <silent> <cmd>make<CR>

This table describes all modes for the keymaps option. You can provide several modes to a single mapping by using a list of strings.

Mode Norm Ins Cmd Vis Sel Opr Term Lang Description
"" yes - - yes yes yes - - Equivalent to :map
"n" yes - - - - - - - Normal mode
"!" - yes yes - - - - - Insert and command-line mode
"i" - yes - - - - - - Insert mode
"c" - - yes - - - - - Command-line mode
"v" - - - yes yes - - - Visual and Select mode
"x" - - - yes - - - - Visual mode only, without select
"s" - - - - yes - - - Select mode
"o" - - - - - yes - - Operator-pending mode
"t" - - - - - - yes - Terminal mode
"l" - yes yes - - - - yes Insert, command-line and lang-arg mode
"!a" - abr abr - - - - - Abbreviation in insert and command-line mode
"ia" - abr - - - - - - Abbreviation in insert mode
"ca" - - abr - - - - - Abbreviation in command-line mode

Each keymap can specify the following settings in the options attrs.

Nixvim Default VimScript
silent false <silent>
nowait false <silent>
script false <script>
expr false <expr>
unique false <unique>
noremap true Use the 'noremap' variant of the mapping
remap false Make the mapping recursive (inverses noremap)
desc "" A description of this keymap

Globals

Sometimes you might want to define a global variable, for example to set the leader key. This is easy with the globals attribute:

{
  programs.nixvim = {
    globals.mapleader = ","; # Sets the leader key to comma
  };
}

Additional config

Sometimes Nixvim won't be able to provide for all your customization needs. In these cases, the extraConfigVim and extraConfigLua options are provided:

{
  programs.nixvim = {
    extraConfigLua = ''
      -- Print a little welcome message when Neovim is opened!
      print("Hello world!")
    '';
  };
}

If you feel like what you are doing manually should be supported in Nixvim, please open an issue.

Contributing

See CONTRIBUTING.md