If Nix and Neovim have one thing in common, it's that many new users don't know where to get started. Most Nix-based Neovim setups assume deep expertise in both realms, abstracting away Neovim's core functionalities as well as the Nix internals used to build a Neovim config.
kickstart-nix.nvim is different: It's geared for users of all levels, making the migration of Neovim configurations to Nix straightforward.
kickstart.nvim, this repository is meant to be used by you to begin your Nix/Neovim journey; remove the things you don't use and add what you miss.
If you have Nix installed (with flakes enabled), you can test drive this by running:
nix run "github:mrcjkb/kickstart-nix.nvim"
nixpkgs.overlays = [ # replace <kickstart-nix-nvim> with the name you chose <kickstart-nix-nvim>.overlays.default ];
You can then add the overlay's output(s) to the
environment.systemPackages = with pkgs; [ nvim-pkg # The default package added by the overlay ];
With Nix installed (flakes enabled), from the repo root:
nix profile install .#nvim
[^1]: The absence of a Nix module DSL for Neovim configuration is deliberate.
If you were to copy the
nvim directory to
it would work out of the box.
after/ directories are not sourced in the Nix derivation.
── nvim ├── ftplugin # Sourced when opening a file type │ └── <filetype>.lua ├── init.lua # Always sourced ├── lua # Shared library modules │ └── user │ └── <lib>.lua └── plugin # Automatically sourced at startup ├── autocommands.lua ├── commands.lua ├── keymaps.lua ├── plugins.lua # Plugins that require a `setup` call └── <plugin-config>.lua # Plugin configurations
- Configuration variables (e.g.
vim.g.<plugin_config>) should go in
nvim/init.luaor a module that is
- Configurations for plugins that require explicit initialization (e.g. via a call to a
setup()function) should go in
- See Initialization order for details.
You can declare Neovim derivations in
There are two ways to add plugins:
nixpkgsas the source.
── flake.nix ── nix ├── mkNeovim.nix # Function for creating the Neovim derivation └── neovim-overlay.nix # Overlay that adds Neovim derivation
This derivation creates an
init.lua as follows:
This means that modules in
nvim/lua can be
nvim/plugin/ are sourced automatically, as if they were plugins.
Because they are added to the runtime path at the end of the resulting
Neovim sources them after loading plugins.
This configuration comes with a few plugins pre-configured.
You can add or remove plugins by
kickstart.nvim: Single-file Neovim configuration template with a similar philosophy to this project. Does not use Nix to manage plugins.
neovim-flake: Configured using a Nix module DSL.
NixVim: A Neovim distribution configured using a NixOS module.
nixCats-nvim: A project with a similar philosophy to this one that organises plugins into categories.