My Neovim configuration using nixvim.
To start configuring, just add or modify the nix files in ./config
.
If you add a new configuration file, remember to add it to the
config/default.nix
file
- Coding
- nvim-cmp
- comment.nvim
- LazyGit
- LuaSnip
- mini
- mini.ai - Better text-objects
- mini.pairs
- mini.surround
- Color scheme
- Editor
- Formatting
- Linting
- LSP
- Treesitter
- UI
- Language support
- Angular
- JSON
- Markdown
- PowerShell
- Tailwind CSS
- TeX
- NeOrg
To test your configuration simply run the following command
nix run .
If you have nix installed, you can directly run my config from anywhere
You can try running mine with:
# Full Version
nix run 'github:magicmonty/nixvim'
# Lighter version without TeX support
nix run 'github:magicmonty/nixvim#lite'
This nixvim
flake will output a derivation that you can easily include
in either home.packages
for home-manager
, or
environment.systemPackages
for NixOS
. Or whatever happens with darwin?
You can add my nixvim
configuration as an input to your NixOS
configuration like:
{
inputs = {
nixvim.url = "github:magicmonty/nixvim";
};
}
With the input added you can reference it directly.
{ inputs, system, ... }:
{
# NixOS
environment.systemPackages = [ inputs.nixvim.packages.${system}.default ];
# home-manager
home.packages = [ inputs.nixvim.packages.${system}.default ];
# Lighter version without TeX support
home.packages = [ inputs.nixvim.packages.${system}.lite ];
}
The binary built by nixvim
is already named as nvim
so you can call it just
like you normally would.
Another method is to overlay your custom build over neovim
from nixpkgs
.
This method is less straight-forward but allows you to install neovim
like
you normally would. With this method you would just install neovim
in your
configuration (home.packges = with pkgs; [ neovim ]
), but you replace
neovim
in pkgs
with your derivation from nixvim
.
{
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
(final: prev: {
neovim = inputs.nixvim.packages.${system}.default;
})
];
}
}
You can just straight up alias something like nix run 'github:magicmonty/nixvim.config'
to nvim
.
If you want to extend this config is your own NixOS config, you can do so using nixvimExtend
.
See here for more info.
Example for overwriting the theme
{
inputs,
lib,
...
}: let
nixvim' = inputs.nixvim.packages."x86_64-linux".default;
nvim = nixvim'.nixvimExtend {
config.theme = lib.mkForce "jellybeans";
};
in {
home.packages = [
nvim
];
}
Parts of this configuration are based on the following configurations: