A bleeding edge Nix flake for LazyVim that automatically tracks LazyVim releases and provides zero-configuration setup for NixOS and home-manager users.
๐ Always up-to-date: Automatically tracks LazyVim releases and uses the latest plugin versions at the time of each LazyVim release.
Add to your flake inputs:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
lazyvim.url = "github:pfassina/lazyvim-nix";
};
outputs = { nixpkgs, home-manager, lazyvim, ... }: {
# Your system configuration
};
}Enable in your home-manager configuration:
{
imports = [ lazyvim.homeManagerModules.default ];
programs.lazyvim.enable = true;
}That's it! Open nvim and enjoy LazyVim.
Pin to a specific LazyVim release:
lazyvim.url = "github:pfassina/lazyvim-nix/v15.13.0"; # Pin to v15.13.0programs.lazyvim = {
enable = true;
extras = {
lang.nix.enable = true;
lang.python = {
enable = true;
installDependencies = true; # Install ruff
installRuntimeDependencies = true; # Install python3
};
lang.go = {
enable = true;
installDependencies = true; # Install gopls, gofumpt, etc.
installRuntimeDependencies = true; # Install go compiler
};
};
# Additional packages (optional)
extraPackages = with pkgs; [
nixd # Nix LSP
alejandra # Nix formatter
];
# Only needed for languages not covered by LazyVim extras
treesitterParsers = with pkgs.vimPlugins.nvim-treesitter-parsers; [
wgsl # WebGPU Shading Language
templ # Go templ files
];
};Note: Treesitter grammars are installed automatically based on enabled language extras.
Control which packages get installed automatically:
programs.lazyvim = {
enable = true;
# Core LazyVim dependencies (git, ripgrep, fd, etc.)
installCoreDependencies = true; # default: true
extras = {
lang.typescript = {
enable = true;
installDependencies = false; # Skip typescript tools
installRuntimeDependencies = true; # But install nodejs
};
};
};Note: Dependencies are opt-in per language. Set to false to manage packages manually via extraPackages.
extraPackages for missing dependencies.
programs.lazyvim = {
enable = true;
config = {
options = ''
vim.opt.relativenumber = false
vim.opt.wrap = true
'';
keymaps = ''
vim.keymap.set("n", "<leader>w", "<cmd>w<cr>", { desc = "Save" })
'';
};
plugins = {
colorscheme = ''
return {
"catppuccin/nvim",
opts = { flavour = "mocha" },
}
'';
};
};Plugin specs can also be written as Nix attrsets instead of Lua strings, using the lazyConfig helper from the flake's lib output:
programs.lazyvim.plugins = {
colorscheme = inputs.lazyvim-nix.lib.lazyConfig {
plugin = "catppuccin/nvim";
opts = { flavour = "mocha"; };
};
# A list generates multiple specs in one file; embed Lua code
# (e.g. functions) with lib.generators.mkLuaInline from nixpkgs
editor = inputs.lazyvim-nix.lib.lazyConfig [
{ plugin = "neovim/nvim-lspconfig"; opts.servers.nixd = { }; }
{ plugin = "folke/noice.nvim";
opts.routes = lib.generators.mkLuaInline "function() return my_routes end"; }
];
};This works anywhere a Lua string is expected, including extras config overrides.
For larger configurations, you can organize your LazyVim config files in a directory:
programs.lazyvim = {
enable = true;
configFiles = ./my-lazyvim-config;
};Directory structure:
my-lazyvim-config/
โโโ config/
โ โโโ keymaps.lua
โ โโโ options.lua
โ โโโ autocmds.lua
โโโ plugins/
โโโ colorscheme.lua
โโโ lsp-config.lua
โโโ editor.lua
Note: You can mix configFiles with inline config and plugins options, but you cannot configure the same file in both places. For example, if configFiles contains config/keymaps.lua, you cannot also set config.keymaps.
- ๐ Always up-to-date - Automatically tracks LazyVim releases with latest plugin versions
- โ Zero-configuration setup - Just enable and go
- ๐ค Reproducible builds - Core and Extra LazyVim plugins locked and in dev mode.
๐ Getting Started - Complete setup guide
โ๏ธ Configuration Reference - Module options and configuration
๐ฏ LazyVim Extras - Language and feature support
๐ง Plugin Sourcing Strategy - How plugins are resolved and managed
๐จ Troubleshooting - Common issues and solutions
nix flake update # Update to latest LazyVim
home-manager switch # Apply changesMIT