Neovim configuration using Nix flakes for plugin management and lz.n for lazy loading. Uses standard Neovim config structure with native Lua files instead of embedding Lua as strings in Nix.
- Nix flake managed plugins
- Lazy loading with lz.n
- Native Lua configuration files
- LSP, autocompletion, formatting, file navigation
- Nix with flakes enabled
- Neovim (I'm using 0.11, but 0.10+ should work too)
- just (optional, for build commands)
Search and file navigation:
Language servers:
- lua-language-server - Lua Language Server
- nixd - Nix Language Server
- bash-language-server - Bash Language Server
Code formatters:
- stylua - Lua code formatter
- alejandra - Nix code formatter
- shfmt - Shell script formatter
- jq - JSON processor and formatter (maybe there are better options for JSON formatting, I use it because it's lightweight and already included in my config)
Make sure these are available in your environment (add to your Nix config) so Neovim plugins work correctly. Here are examples for different Nix setups:
Add to your configuration.nix:
programs.neovim = {
enable = true;
viAlias = true; # optional
vimAlias = true; # optional
};
environment.systemPackages = with pkgs; [
just # optional
ripgrep
fzf
lua-language-server
stylua
nixd
alejandra
bash-language-server
shfmt
jq
];Add to your home.nix:
programs.neovim = {
enable = true;
viAlias = true; # optional
vimAlias = true; # optional
};
home.packages = with pkgs; [
just # optional
ripgrep
fzf
lua-language-server
stylua
nixd
alejandra
bash-language-server
shfmt
jq
];Clone this repo to neovim config directory and build.
If you want to use a different config directory, set NVIM_APPNAME env variable before cloning.
See https://neovim.io/doc/user/starting.html#_nvim_appname for details.
# this will change config directory to ~/.config/nvim-lznix
# add this to your shell config file if you want to make it permanent
# unset it to use default ~/.config/nvim
export NVIM_APPNAME=nvim-lznixSkip above if you want to use default ~/.config/nvim.
git clone https://github.com/bearoffwork/nvim-lznix ~/.config/"${NVIM_APPNAME:-nvim}"
cd ~/.config/"${NVIM_APPNAME:-nvim}"
# install plugins
nix build . -o pack
# or if you have just installed
just build- lz.n - Plugin lazy loading manager
- nvim-lspconfig - LSP configuration
- blink.cmp - Completion engine
- conform.nvim - Code formatting
- telescope.nvim - Fuzzy finder
- oil.nvim - File explorer as a buffer
- mini.nvim - Collection of minimal modules:
- mini.files - File manager
- mini.icons - Icon provider
- mini.misc - Miscellaneous utilities (auto root detection, etc.)
- catppuccin-nvim - Color scheme
- nvim-treesitter - Syntax highlighting
- lazydev.nvim - Lua development support
- plenary.nvim - Lua utility functions
All plugins are managed via nix flake and loaded lazily with lz.n for optimal startup performance.