{"id":14967892,"url":"https://github.com/nix-community/nix4nvchad","last_synced_at":"2025-06-26T00:04:30.858Z","repository":{"id":254385866,"uuid":"846288186","full_name":"nix-community/nix4nvchad","owner":"nix-community","description":"Install NvChad on Nix-based system [maintainer=@Bot-wxt1221, @MOIS3Y]","archived":false,"fork":false,"pushed_at":"2025-06-20T03:15:18.000Z","size":269,"stargazers_count":87,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T04:25:31.620Z","etag":null,"topics":["home-manager-module","nix","nix-community-buildbot","nix-flakes","nixos-configuration","nvchad"],"latest_commit_sha":null,"homepage":"https://nvchad.com/","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nix-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"nix-community"}},"created_at":"2024-08-22T22:38:55.000Z","updated_at":"2025-06-19T07:05:19.000Z","dependencies_parsed_at":"2024-08-23T05:48:13.327Z","dependency_job_id":"afa96313-dcbe-4272-9b94-e801dfd33c6b","html_url":"https://github.com/nix-community/nix4nvchad","commit_stats":{"total_commits":36,"total_committers":7,"mean_commits":5.142857142857143,"dds":0.5,"last_synced_commit":"fb41007756baa31427e27426be5c0b092f82baa2"},"previous_names":["nix-community/nix4nvchad"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nix-community/nix4nvchad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnix4nvchad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnix4nvchad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnix4nvchad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnix4nvchad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nix-community","download_url":"https://codeload.github.com/nix-community/nix4nvchad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnix4nvchad/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261331377,"owners_count":23142679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["home-manager-module","nix","nix-community-buildbot","nix-flakes","nixos-configuration","nvchad"],"created_at":"2024-09-24T13:38:50.006Z","updated_at":"2025-06-26T00:04:30.846Z","avatar_url":"https://github.com/nix-community.png","language":"Nix","funding_links":["https://opencollective.com/nix-community"],"categories":["nix","Editors and IDEs"],"sub_categories":[],"readme":"# NvChad on Nix\n\n![logo](https://nvchad.com/screenshots/onedark.webp)\n\n## What is it?\n\nThe repository contains nix flake to install the [NvChad](https://nvchad.com/)\nconfiguration on any system that uses `Nix` and `nix flakes`.\n\n### Flake contains:\n\n- nvchad package\n- home-manager module\n\nYou can choose any of the presented methods to install NvChad.\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e \u003cb\u003eGeneral notes\u003c/b\u003e \u003c/summary\u003e\n  \u003cbr/\u003e\n  NvChad itself is not an executable file, it is a perfect configuration for [Neovim](https://neovim.io/).\n\n  Unfortunately there is no easy way to add it to `/nix/store`\n  More precisely, it’s easy to add it, but it won’t work, at least for now (version 2.5)\n\n  This is due to the fact that by default `neovim` reads \n  the file `~/.config/nvim/init.lua` and starts.\n  NvChad lazily loads plugins and on first load, `lazyvim` will save\n  `lazy-lock.json` next to `~/.config/nvim/init.lua`\n  As you understand, this is not a problem for any distribution and it \n  does not violate the principles of [The Twelve Factor App](https://12factor.net/config)\n  because, as already said, NvChad is a configuration and not a package with an application.\n  But with Nix the problem is /nix/store is a read-only system,\n  the source code trying to write a file or change the current one will result in an error.\n  There will also be a problem with the ability to change the configuration\n  on the fly, since this changes the `chadrc.lua` file\n\n  The method We used to solve this problem (home-manager module) is a hack.\n  Don't worry, it doesn't break anything, but it doesn't follow the basic\n  principle of how home-manager adds configuration files to the user's home directory.\n  Absolutely all configuration files are stored in `/nix/store/`\n  By default, the home manager creates symbolic links from `/nix/store/` to the user's home directory.\n  This ensures that configuration changes after the next generation build are available to the user.\n\n  In addition, if you have ever created a declarative configuration\n  for vanilla `neovim` you know that plugins are also stored in `/nix/store/`\n  NvChad installs plugins in `~/.local/share/nvim/`.\n  This is not a problem for us, they are still immutable until you explicitly update them.\n  If your own NvChad configuration which you pass\n  to the module as `config.programs.nvchad.extraConfig`\n  contains `lazy-lock.json` specific plugin versions will be installed.\n\n  Here's everything you need to know before you start using NvChad with Nix\n  If you still need to add NvChad to your configuration, welcome!\n\u003c/details\u003e\n\n\n## How it works?\n\n- you add this repository as `inputs` to flake.nix of your configuration\n- you add a package with `NvChad` to your configuration as an overlay or as a `home-manager` module\n- specify extraPackages and extraConfig for the package or module\n- you are building a new system generation\n- as a result, you will receive an executable file `nvim`, nvim.desktop to launch from the launcher and your own configuration overlay if you passed extraConfig\n- each extraPackages is available to NvChad, if this is for example an LSP server, NvChad will find its executable file\n- extraPackages are not available globally, they are only available in the NvChad scope\n- if you do not pass any parameters only `extraPackages` for starter configuration are included\n\n\n# Quick use without installation to try\n\n```console\nnix run github:nix-community/nix4nvchad/#nvchad\n```\n\n\u003e [!WARNING]\n\u003e Run the command above if you are not using your `neovim` configuration!\n\u003e - If you already have a `neovim` configuration in `~/.config/nvim` and `init.lua` is present there\n\u003e nvchad will not copy the configuration to the home directory and will probably not start correctly\n\u003e - If there is no `init.lua` in `~/.config/nvim` but there are any other files, this will overwrite\n\u003e `~/.config/nvim` with the `NvChad starter` configuration\n\u003e - Your current configuration will be saved in `~/.config/nvim/nvim_%Y_%m_%d_%H_%M_%S.bak`\n\n\n# Installation\n\nTo install it you **must have flake enabled** and your NixOS configuration\n**must be managed with flakes.** See [Flakes](https://nixos.wiki/wiki/Flakes) for\ninstructions on how to install and enable them on NixOS.\n\n### First step\n\nYou can add this flake as inputs in `flake.nix` in the repository\ncontaining your NixOS configuration:\n\n```nix\n  inputs = {\n    nixpkgs.url = \"github:nixos/nixpkgs/nixos-unstable\";\n    home-manager = {\n      url = \"github:nix-community/home-manager\";\n      inputs.nixpkgs.follows = \"nixpkgs\";\n    };\n    # ...\n    nix4nvchad = {\n      url = \"github:nix-community/nix4nvchad\";\n      inputs.nixpkgs.follows = \"nixpkgs\";\n    };\n    # ...\n  };\n```\n\nThis flake provides an overlay for Nixpkgs, with package and a home-manager module.\n\nThey are respectively found in the flake as\n\n- `inputs.nix4nvchad.packages.${system}.default`\n- `inputs.nix4nvchad.packages.${system}.nvchad`\n\n\n- `inputs.nix4nvchad.homeManagerModules.default`\n- `inputs.nix4nvchad.homeManagerModules.default`\n- `inputs.nix4nvchad.homeManagerModule`\n\n(Where `${system}` is either `x86_64-linux` `aarch64-linux` `x86_64-darwin` `aarch64-darwin`)\n\n### Second step\n\nOutput data can be added in different ways, for example this is how I do it for NixOS:\n\nIn the example below, the home manager is installed as a NixOS module\n\n```nix\n  outputs = { self, nixpkgs, home-manager, ... }@inputs:\n    let\n      system = \"x86_64-linux\";\n      lib = nixpkgs.lib;\n      extraSpecialArgs = { inherit system inputs; };  # \u003c- passing inputs to the attribute set for home-manager\n      specialArgs = { inherit system inputs; };       # \u003c- passing inputs to the attribute set for NixOS (optional)\n    in {\n    nixosConfigurations = {\n      dummy-host = lib.nixosSystem {\n        modules = [\n          inherit specialArgs;           # \u003c- this will make inputs available anywhere in the NixOS configuration\n          ./path/to/configuration.nix\n          home-manager.nixosModules.home-manager {\n            home-manager = {\n              inherit extraSpecialArgs;  # \u003c- this will make inputs available anywhere in the HM configuration\n              useGlobalPkgs = true;\n              useUserPackages = true;\n              users.dummyUserName = import ./path/to/home.nix;\n            };\n          }\n        ];\n      };\n    };\n  };\n```\n\nIf you are new to NixOS here is a useful channel [Vimjoyer](https://www.youtube.com/watch?v=rEovNpg7J0M)\n\n\n### Third step (optional)\n\nAll we have to do is add `nvchad` to the list of available packages using overlays\n\nSomewhere in your `configuration.nix`\n\n```nix\n{ config, pkgs, inputs, ... }: {  # \u003c-- inputs from flake\n  # ...\n  nixpkgs = { \n    overlays = [\n      (final: prev: {\n        nvchad = inputs.nix4nvchad.packages.\"${pkgs.system}\".nvchad;\n      })\n    ];\n  };\n  # ...\n}\n```\n\nNow you can call the package anywhere as a package from nixpkgs\n\n- `pkgs.nvchad`\n\nExamples:\n- `users.users.\u003cname\u003e.packages = [ pkgs.nvchad ];` NixOS\n- `home.packages = with pkgs; [ pkgs.nvchad ];`  home-manager\n\n# Configuration\n\nDepending on which usage method you choose, take a look at a couple of snippets:\n\n### home-manager module\n\nSomewhere in your `home.nix` or a separate module:\n\nDefault:\n\n```nix\n{ inputs, config, pkgs, ... }: {\n  imports = [\n    inputs.nix4nvchad.homeManagerModule\n  ];\n  programs.nvchad.enable = true;\n}\n```\n\nOr with customization of options:\n\n\n```nix\n{ inputs, config, pkgs, ... }: {\n  imports = [\n    inputs.nix4nvchad.homeManagerModule\n  ];\n  programs.nvchad = {\n    enable = true;\n    extraPackages = with pkgs; [\n      nodePackages.bash-language-server\n      docker-compose-language-service\n      dockerfile-language-server-nodejs\n      emmet-language-server\n      nixd\n      (python3.withPackages(ps: with ps; [\n        python-lsp-server\n        flake8\n      ]))\n    ];\n    hm-activation = true;\n    backup = true;\n  };\n}\n```\n\n### Available options:\n\n- [enable](#enable)\n- [neovim](#neovim)\n- [extraPlugins](#extraPlugins)\n- [extraPackages](#extraPackages)\n- [extraConfig](#extraConfig)\n- [gcc](#gcc)\n- [lazy-lock](#lazy-lock)\n- [hm-activation](#hm-activation)\n- [backup](#backup)\n\nAll options are not required\n\n##### enable\n\n`true` or `false`\n\nIf false ignore this module when build new generation\n\n##### neovim\n\n`pkgs.neovim`\n\nNeovim package for use under nvchad wrapper\n\n##### extraPlugins\n\n```lua\nreturn {\n  {\"equalsraf/neovim-gui-shim\",lazy=false},\n  {\"lervag/vimtex\",lazy=false},\n  {\"nvim-lua/plenary.nvim\"},\n  {\n    'xeluxee/competitest.nvim',\n    dependencies = 'MunifTanjim/nui.nvim',\n    config = function() require('competitest').setup() end,\n  },\n}\n```\n\nThe extra plugins you want to install. Loaded by lazy.nvim\n\n##### extraPackages\n\n`[]` list of pkgs\n\nList of additional packages available for NvChad as runtime dependencies\nNvChad extensions assume that the libraries it need\nwill be available globally.\nBy default, all dependencies for the starting configuration are included.\nOverriding the option will expand this list.\n\n##### extraConfig\n\n`string`\n\nThe config written in lua. It will be loaded after nvchad loaded.\n\n#### chadrcConfig (optional)\n\n`string`\n\nConfiguration that replaces `chadrc.lua.` Make sure to include `local M = {}` at the top, and `return M` at the bottom.\n\n##### gcc\n\n`pkg.gcc`\n\nThe gcc compiler you want to use.\n\n##### lazy-lock\n\n`string`\n\nA json file. Which is in ~/.config/nvim/lazy-lock.json to lock lazy.nvim's plugin.\n\nLeave it as \"\" if don't want it.\n\n##### hm-activation\n\n`true` or `false`\n\nIt's a trick\nIf you do not want home-manager to manage nvchad configuration, \nset the false option. In this case, HM will not copy the configuration\nsaved in /nix/store to ~/.config/nvim.\nThis way you can customize the configuration in the usual way\nby cloning it from the NvChad repository.\nBy default, the ~/.config/nvim is managed by HM.\n\n##### backup\n\n`true` or `false`\n\nSince the module violates the principle of immutability\nand copies NvChad to `~/.config/nvim` rather than creating\na symbolic link by default, it will create a backup copy of\n`~/.config/nvim_%Y_%m_%d_%H_%M_%S.bak` when each generation.\nThis ensures that the module\nwill not delete the configuration accidentally.\nYou probably do not need backups, just disable them\n`config.programs.nvchad.backup = false;`\n\n\n# Usage\n\nWhichever method you choose, after installation you'll probably want to run `NvChad`.  \nUsing the `nvim` wrapper executable it will be automatically available in your `$PATH`.  \nYou can also launch through the application manager (rofi, wofi, etc).  \nThe package comes with `nvim.desktop`.  \n\nIf you are not using the HM module or have disabled `hm-activation`:\n- `NvChad` expects `~/.config/nvim/init.lua` to be available at startup\n- if the file does not exist, `NvChad` will copy it and all files from `/nix/store/hash-nvchad-2.5/config`\n- this will be either your configuration or starter\n- if `~/.config/nvim/` is not empty `NvChad` will create a backup copy nearby\n\n#### Note!\n\nIf you are using the NvChad home-manager module, do not add neovim from the standard module:\n\n```nix\nprograms.neovim.enable = true;\n```\nAlso, do not add neovim as a package to the configuration:\n ```nix\nhome.packages = [ pkgs.neovim ];\n```\n\n# Use your own NvChad configuration\n\nYou can use your own NvChad configuration by providing your own repository or local folder.  \nIt has to follow the structure of [the NvChad starter](https://github.com/NvChad/starter) (a fork or local copy).  \n\n```nix\n  inputs = {\n    # Default:\n    nixpkgs.url = \"github:nixos/nixpkgs/nixos-unstable\";\n    home-manager = {\n      url = \"github:nix-community/home-manager\";\n      inputs.nixpkgs.follows = \"nixpkgs\";\n    };\n\n    # adding the starter input here\n    nvchad-starter = {\n      url = \"github.com:\u003cgithub-username\u003e/\u003crepository-name\u003e\"; # \u003c- replace this with your own\n      # url = \"path:\u003clocal_path\u003e\" # \u003c- for local relative folder (e.g. path:./home/nvim) \n      flake = false;\n    }\n\n    nix4nvchad = {\n      url = \"github:nix-community/nix4nvchad\";\n      inputs.nixpkgs.follows = \"nixpkgs\";\n      inputs.nvchad-starter.follows = \"nvchad-starter\"; # \u003c- overwrite the module input here\n    };\n  };\n```\n\nAnd follow above steps.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-community%2Fnix4nvchad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnix-community%2Fnix4nvchad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-community%2Fnix4nvchad/lists"}