How to install NvChad in NixOS?

#Beginner + NixOS + Neovim

How to install NvChad in NixOS?

Install NvChad in NixOS in less than five minutes.

--

NvChad is a famous framework or pre-configuration for neovim due to its beautiful UI and features. The best part is You don’t need to install a plugin or configuration for Neovim; nvchad comes to everything pre-configured

This tutorial is part of an upcoming series of articles where I guide you on how to install the neovim framework in nixos.

To use NvChad, You need to know about shortcuts or keymapping related to nvchad and neovim. It increases productivity without installing or configuring additional stuff.

Steps

  1. Install Neovim and Additional packages
    NixOS Configuration
    Home Manager
  2. Install NvChad
    How to uninstall NvChad in NixOS?
  3. Conclusion

Install Neovim and Additional packages

To install NvChad in NixOS, there are two ways:

  1. NixOS Configuration
  2. Home Manager

Even if you use the NixOS configuration and the home manager method, some of the additional packages are optional, and some require you to install them to improve the productizing and functionality of nvchad.

NixOS Configuration

# NixOS Configuration (configuration.nix)

packages = with pkgs; [
neovim
(nerdfonts.override {fonts = ["FiraCode"];}) # Install specific nerd fonts in NixOS
ripgrep # Enhance the teaching experience grep and telescope
xclip # or clipcat
];

Home Manager

# Home Manager (home.nix)

home.packages = with pkgs; [
neovim
(nerdfonts.override {fonts = ["FiraCode"];}) # Install specific nerd fonts in NixOS
ripgrep # Enhance the teaching experience grep and telescope
xclip # or clipcat
];
  • (nerdfonts.override {fonts = [“FiraCode”];}): Install specific nerd fonts in NixOS.
  • ripgrep: Enhance the teaching experience grep and telescope.
  • xclip: xclip is a tool for copying and pasting text into the terminal. As an alternative, you can use the Clipcat, etc.

Install NvChad

Lastly, run the following script to install nvchad.

git clone https://github.com/NvChad/starter ~/.config/nvim && nvim
  • If nvchad does not install the neovim plugin automatically, then run the :MasonInstallAll command in neovim.
  • Lastly, delete the .git folder from the vim folder.

How to uninstall NvChad in NixOS?

First, remove or uninstall Neovim and Additional packages, and then remove the .config/nvim file.

sudo rm -rf ~/.config/nvim

Conclusion

NvChad is a famous neovim framework; if you are a beginner in the neovim ecosystem, nvchad is the best choice for you.

--

--

Rajdeep Singh
The Linux

JavaScript | TypeScript | Reactjs | Nextjs | Rust | Biotechnology | Bioinformatic | Frontend Developer | Author | https://linktr.ee/officialrajdeepsingh