Skip to content

codevogel/nestvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nestvim 🪺

Nestvim is my Neovim config housed in a standalone nix flake.

It uses Gerg-L's 'Minimal Neovim Wrapper' (mnw) to wrap my neovim config (including everything it needs to function, like fzf and LSPs) into a reproducible package.

Run my config

You can run my neovim config on any Nix machine using:

nix run github:codevogel/nestvim

Or fork/clone it locally if you want to adapt it:

git clone git@github.com:codevogel/nestvim.git
cd nestvim
nix run

For hot reloading the config use the #dev attribute:

cd nestvim
nix run .#dev

Use in your own config

I wouldn't recommend using my config as everyone has their own needs, but this might help you understand how to set up mnw for your own nix-based neovim config.

Add this to your flake.nix, say in ~/yournixos/flake.nix:

{
  inputs = {
    nestvim.url = "github:codevogel/nestvim"; # or point this to your own flake
    inputs.nixpkgs.follows = "nixpkgs";
    # If you use mnw or neovim elsewhere, you might want to follow those too.
  };

  outputs =
    {
      self,
      nixpkgs,
      nestvim,
      ...
    }@inputs:
    {

      packages.x86_64-linux = {
        # map 'nestvim' attribute to the default package from the nestvim flake
        nestvim = nestvim.packages.x86_64-linux.default;
        # map 'dev' attribute to the 'dev' package from the nestvim flake for
        # hot reloading
        dev = nestvim.packages.x86_64-linux.dev;
      };

      nixosConfigurations = { # redacted for brevity };
}

Then add this to your neovim.nix, say in ~/yournixos/modules/neovim.nix:

{
  self,
  ...
}:

{
  environment.systemPackages = [
    # this is the 'nestvim' we defined in the flake.nix outputs
    self.packages.x86_64-linux.nestvim
  ];
}

And import that into your configuration.nix, say in ~/yournixos/hosts/my-host/configuration.nix:

{ ... }:

{
  imports =
    [
      ../../neovim.nix # or wherever you put it
      # other imports...
    ];
}

Now you can run nvim, or alternatively, nix run ~/yournixos#nestvim or nix run ~/yournixos#dev

You can then update your config by nix flake update nestvim to update just the nestvim input.

About

My neovim config in a standalone Nix flake using Gerg-L/mnw

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors