Skip to content

Options

aliases

Aliases to symlink nvim to.

Type
plaintext
list of string
Default
nix
[ ]
Example
nix
[
  "vi"
  "vim"
]
Declaration

appName

What to set $NVIM_APPNAME to

Type
plaintext
string
Default
nix
"mnw"
Example
nix
"gerg"
Declaration

desktopEntry

Whether to enable neovim's desktop entry.

Type
plaintext
boolean
Default
nix
true
Example
nix
false
Declaration

enable

Whether to enable mnw (Minimal Neovim Wrapper).

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

extraBinPath

Extra packages to be put in neovim's PATH

Type
plaintext
list of package
Default
nix
[ ]
Example
nix
[
  pkgs.rg
  pkgs.fzf
]
Declaration

extraBuilderArgs

Extra attributes to pass to mkDerivation.

Type
plaintext
attribute set of anything
Default
nix
{ }
Example
nix
{
  doInstallCheck = true;
  extraInstallCheckInputs = [ pkgs.hello ];
  installCheckPhase = ''
    hello
  '';
}
Declaration

extraLuaPackages

A function which returns a list of extra needed lua packages.

Type
plaintext
function that evaluates to a(n) list of package
Default
nix
ps: [ ]
Example
nix
ps: [ ps.jsregexp ]
Declaration

finalPackage

The final package to be consumed by the user

Type
plaintext
package
Declaration

initLua

lua config text to load at startup

Type
plaintext
strings concatenated with "\n"
Default
nix
""
Example
nix
''
  require("myConfig")
''
Declaration

initViml

VimL config text to load at startup

Type
plaintext
strings concatenated with "\n"
Default
nix
""
Example
nix
''
  echomsg 'hello world'
''
Declaration

luaFiles

lua config files to load at startup

Type
plaintext
list of path in the Nix store
Default
nix
[ ]
Example
nix
[
  (pkgs.writeText "init.lua" ''
    print('hello world')
  '')
]
Declaration

neovim

The neovim package to use. Must be unwrapped

Type
plaintext
package
Default
nix
pkgs.neovim-unwrapped
Example
nix
inputs.neovim-nightly-overlay.packages.${pkgs.stdenv.system}.default
Declaration

vimlFiles

VimL config files to load at startup

Type
plaintext
list of path in the Nix store
Default
nix
[ ]
Example
nix
[
  (pkgs.writeText "init.vim" ''
    echomsg 'hello world'
  '')
]
Declaration

wrapperArgs

A list of arguments to be passed to makeWrapper

Type
plaintext
list of string
Default
nix
[ ]
Example
nix
[
  "--set-default"
  "FZF_DEFAULT_OPTS"
  "--layout=reverse --inline-info"
]
Declaration

Plugins Configuration

Plugins are a package, a relative path, or an attribute set with a name/pname and a src:

nix
{
  pname = "hello";
  src = <package or relative path>;
}

TIP

Use dev.<name> for your config see usage and then examples for full examples

start and startAttrs are added to /start and are require()-able while opt and optAttrs are added to /opt and must be packadd'd or loaded by lz.n/lazy.nvim before being require()'d

Everything in opt/start have their .dependencies added to startAttrs as well (for nixpkgs compatibility) plugins added directly to *Attrs do not resolve .dependencies

The assignment to *Attrs is done by resolving the pname or name of the package. so { pname = "foo"; ... would be put at *Attrs.foo

While if it's a path it'll be added by the path name and then the hash of the path so it's recommended to use *Attrs for path plugins:

nix
{
  plugins.startAttrs.fzf-lua = ./fzf-lua;
}

*Attrs plugins can be set to null to stop them from being installed like:

nix
{
  plugins.startAttrs.fzf-lua = null;
}

this is useful for not installing .dependencies from nixpkgs plugins

Any plugin in opt will override the plugin of the same name in start when propagating to *Attrs to ensure it's not loaded automatically.

TIP

there's no reason to use buildVimPlugin as all it does is copy files generate help tags and run checks. with mnw help tags are generated in the mnw builder

Full example:

nix
{
  plugins = {
    # Plugins which can be reloaded without rebuilding
    # see dev mode in the docs
    dev.myconfig = {
      # This is the recommended way of passing your config
      pure = "myconfig";
      impure = "/home/user/nix-config/nvim";
    };

    # List of plugins to load automatically
    start = [
      # you can pass vimPlugins from nixpkgs
      pkgs.vimPlugins.lz-n

      # path plugin
      ./plugin

      # Custom plugin example
      {
        pname = "customPlugin";

        src = pkgs.fetchFromGitHub {
          owner = "";
          repo = "";
          ref = "";
          hash = "";
        };

        # Plugins can have other plugins as dependencies
        # this is mainly used in nixpkgs
        # avoid it if possible
        dependencies = [ ];
      }
    ];

    # Attribute set of plugins to load automatically
    startAttrs = {
      # nixpkgs plugin
      oil-nvim = pkgs.vimPlugins.oil-nvim;

      # Stop a dependency from a nixpkgs plugin from being installed
      someDependency = null;

      # Path plugin
      foo = ./bar;
    };

    # List of plugins to not load automatically
    # (load with packadd or a lazy loading plugin )
    opt = [
      pkgs.vimPlugins.oil-nvim
    ];

    # Attribute set of plugins to not load automatically
    optAttrs = {
      # nixpkgs plugin
      fzf-lua = pkgs.vimPlugins.fzf-lua;

      # Disable a optional plugin
      disableMe = null;

      # Path plugin
      bar = ./baz;
    };

  };
}

plugins.dev

Plugins for use with devMode. You most likely want to put your config here. (automatically loaded)

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Example
nix
{
  myconfig = {
    pure = ./nvim;
    impure = "/home/user/nix-config/nvim";
  };
}
Declaration

plugins.dev.<name>.impure

The impure absolute paths to the nvim plugin.

Type
plaintext
absolute path
Example
nix
"/home/user/nix-config/nvim"
Declaration

plugins.dev.<name>.pure

The pure path to the nvim plugin.

Type
plaintext
literal path or package
Example
nix
./nvim
Declaration

plugins.opt

Type
plaintext
list of (literal path or package)
Default
nix
[ ]
Declaration

plugins.optAttrs

Type
plaintext
attribute set of (null or literal path or package)
Default
nix
{ }
Declaration

plugins.start

Type
plaintext
list of (literal path or package)
Default
nix
[ ]
Declaration

plugins.startAttrs

Type
plaintext
attribute set of (null or literal path or package)
Default
nix
{ }
Declaration

Provider Configuration

providers.nodeJs.enable

Whether to enable and configure the Node.js provider.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

providers.nodeJs.neovimClientPackage

The neovim-node-client package to use.

Type
plaintext
package
Default
nix
pkgs.neovim-node-client
Example
nix
pkgs.neovim-node-client
Declaration

providers.nodeJs.package

The Node.js package to use.

Type
plaintext
package
Default
nix
pkgs.nodejs
Example
nix
pkgs.nodejs_23
Declaration

providers.perl.enable

Whether to enable and configure the perl provider.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

providers.perl.extraPackages

Extra packages to be included in the perl environment.

Note: you probably want to include NeovimExt and Appcpanminus if you change this from it's default value.

Type
plaintext
function that evaluates to a(n) list of package
Default
nix
p: [
  p.NeovimExt
  p.Appcpanminus
]
Example
nix
p: [
  p.NeovimExt
  p.Appcpanminus
]
Declaration

providers.perl.package

The perl package to use.

Type
plaintext
package
Default
nix
pkgs.perl
Example
nix
pkgs.perl
Declaration

providers.python3.enable

Whether to enable and configure the python3 provider.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

providers.python3.extraPackages

Extra packages to be included in the python3 environment.

Note: you probably want to include pynvim if you change this from it's default value.

Type
plaintext
function that evaluates to a(n) list of package
Default
nix
p: [ ppynvim ]
Example
nix
py: [
  py.pynvim
  py.pybtex
]
Declaration

providers.python3.package

The python3 package to use.

Type
plaintext
package
Default
nix
pkgs.python3
Example
nix
pkgs.python39
Declaration

providers.ruby.enable

Whether to enable and configure the ruby provider.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

providers.ruby.env

The ruby bundlerEnv to use.

Type
plaintext
package
Default
nix
pkgs.bundlerEnv {
  name = "neovim-ruby-env";
  gemdir = ../ruby_provider;
  postBuild = '''
    rm $out/bin/{bundle,bundler}
  ''';
}
Example
nix
pkgs.bundlerEnv {
  name = "neovim-ruby-env";
  gemdir = ../ruby_provider;
}
Declaration

providers.ruby.package

The ruby package to use.

Type
plaintext
package
Default
nix
programs.mnw.providers.ruby.env.ruby
Example
nix
pkgs.ruby
Declaration