NxChad is a nixvim module that brings the UI feel of NvChad to your Neovim setup-powered by the Nix ecosystem.
You can use all the features in nvchad, but a few things are different:
- Nixvim based. NxChad using nixvim, instead just plain lua. You still have full access to Lua if you prefer, but your plugins and configuration are managed declaratively via nix.
- Fast Lazy Loading with lz-n. Instead of
lazy.nvim. NxChad uses lz-n for plugin lazy loading. Whilelazy.nvimsupported in nixvim,lz-nintegrates more flexibly and predictable (as proven in nvchad.nix) - Temporary Theme Switching. Change your color scheme on-the-fly without altering your core config. If you want a theme change to stick, simply write it to your nixvim config
You can try it without installing it into the system using nix run or nix shell
$ nix run github:fmway/nxchad --override-input nixpkgs flake:nixpkgs
# or use nix shell
$ nix shell github:fmway/nxchad --override-input nixpkgs flake:nixpkgs
$ nvimCurrently, nxchad is only supported on flakes
-
Add
nixvimandnxchadin your inputs.inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixvim.url = "github:nix-community/nixvim"; nixvim.inputs.nixpkgs.follows = "nixpkgs"; nxchad.url = "github:fmway/nxchad"; # This is important, since nxchad dosn't add nixpkgs repo in dependencies nxchad.inputs.nixpkgs.follows = "nixpkgs"; # ... };
-
Import
nxchadto your configuration.You can import
nxchadin Home Manager, NixOS, nix-darwin, or in standalone package. Here is the example:Home Manager
{ outputs = { nixpkgs, home-manager, nxchad, nixvim, ... }: { homeConfigurations.user = home-manager.lib.homeConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; modules = [ nixvim.homeManagerModules.nixvim nxchad.homeManagerModules.nixvim { programs.nixvim.enable = true; programs.nixvim = { # set relative number opts.relativenumber = true; }; } # ... ]; }; }; }
NixOS
outputs = { nixpkgs, nxchad, nixvim, ... }: { nixosConfigurations.localhost = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ nixvim.nixosModules.nixvim nxchad.nixosModules.nixvim { programs.nixvim.enable = true; programs.nixvim = { # change theme nvchad nvchad.config.base46.theme = "starlight"; }; # ... } ]; }; };
Nix Darwin
outputs = { nixpkgs, nix-darwin, nixvim, nxchad, ... }: { darwinConfigurations = nix-darwin.lib.darwinSystem { modules = [ nixvim.nixDarwinModules.nixvim nxchad.nixDarwinModules.nixvim { programs.nixvim.enable = true; programs.nixvim = { # add vim-notify plugins.notify.enable = true; }; # ... } ]; }; }
Standalone
Example in standalone + nixos
outputs = { nixpkgs, nxchad, nixvim, ... }: { nixosConfigurations.localhost = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ ({ pkgs, ... }: { environment.systemPackages = [ nixvim.legacyPackages.${pkgs.system}.makeNixvimWithModule { module = { imports = [ nxchad.nixvimModules.default # ... ]; # add toggleterm plugin plugins.toggleterm.enable = true; # lazyload plugins.toggleterm.lazyLoad = { enable = true; settings.event = [ "User FilePost"]; }; }; }; ]; }) # ... ]; }; };
If you want to configure chadrc, you can write it in nxchad.config or nvchad.config. The configuration specifications are the same as for chadrc, you can find all the options at https://nxchad-options.pages.dev or https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua. For example, to disable nvdash at startup:
nxchad.config.nvdash.load_on_startup = false;- lazy load plugins.
- base46 compability
- chadrc options
- options to choose
blink.cmpornvim-cmp(since nvchad ui supports both) - raw lua support options
- nix4nvchad - a wrapper of neovim that sits on top of nixpkgs