Skip to content

Instantly share code, notes, and snippets.

@juangiordana
Last active May 15, 2025 03:16
Show Gist options
  • Save juangiordana/3c77d199cf5b2cff52ecedecf89ffaed to your computer and use it in GitHub Desktop.
Save juangiordana/3c77d199cf5b2cff52ecedecf89ffaed to your computer and use it in GitHub Desktop.
Simple instructions to run Neovim distributions in NixOS

Run Neovim distributions in NixOS

tl;dr

# /etc/nixos/configuration.nix
{
  programs.nix-ld.enable = true;
}
# ~/.config/home-manager/home.nix
{
  home.shellAliases = {
    # kickstart.nvim
    # - https://github.com/nvim-lua/kickstart.nvim
    # git clone --depth 1 [email protected]:nvim-lua/kickstart.nvim.git ~/.config/nvim-kickstart
    nvkick = "env NVIM_APPNAME='nvim-kickstart' nvim";

    # LazyVim
    # - https://www.lazyvim.org/
    # - https://github.com/LazyVim/starter
    # git clone --depth 1 [email protected]:LazyVim/starter.git ~/.config/nvim-lazyvim
    nvlazy = "env NVIM_APPNAME=nvim-lazyvim nvim";

    # LunarVim
    # - https://www.lunarvim.org/
    # - https://github.com/lunarvim/lunarvim
    # git clone --depth 1 [email protected]:LunarVim/LunarVim.git ~/.config/nvim-lunarvim
    nvlunar = "env NVIM_APPNAME=nvim-lunarvim nvim";

    # NvChad
    # - https://nvchad.com/
    # - https://github.com/NvChad/NvChad/
    # git clone --depth 1 [email protected]:NvChad/NvChad.git ~/.config/nvim-nvchad
    nvchad = "env NVIM_APPNAME=nvim-nvchad nvim";
  };
}
  1. Enable nix-ld in order to run unpatched dynamic binaries, as from Mason, within NixOS.
# /etc/nixos/configuration.nix
{
  programs.nix-ld.enable = true;
}
  1. Setup kickstart.nvim

Ensure kickstart.nvim external requirements are met: git, make, unzip, gcc

nix shell nixpkgs#{gcc,gnumake,neovim,unzip}
  • (Optional) Clear previous kickstart.nvim data for a fresh setup:
rm -rf ~/{.cache,.local/share,.local/state}/nvim-kickstart
  • Clone initial configurations:
git clone --depth 1 [email protected]:nvim-lua/kickstart.nvim.git ~/.config/nvim-kickstart
  1. Launch Neovim in the development shell:
env NVIM_APPNAME='nvim-kickstart' nvim

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment