The NixOS flake and Home Manager were setup following this tutorial
# From root dir of the configuration
$ ls
catsnvim configuration.nix flake.lock flake.nix hardware-configuration.nix home.nix
To add nixCats to Home Manager...
Add the flake in a subdirectory :
mkdir catsnvim
cd catsnvim
nix flake init -t github:BirdeeHub/nixCats-nvim#example
Add the new flake as input catsnvim to our configuration using a path:
inputs = {
# ... other inputs
catsnvim = {
url = "path:.catsnvim";
inputs.nixpkgs.follows = "nixpkgs";
};
};Add catsvim to outputs arguments. The flake exports various modules. For Home Manager setup, pass catsnvim.homeModule to home-manager:
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, catsnvim, ... }: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
specialArgs.pkgs-unstable = import nixpkgs-unstable {
system = "x86_64-linux";
};
modules = [
./hardware-configuration.nix
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.axelb = {
imports = [ catsnvim.homeModule ./home.nix ];
};
}
];
};
};Enable nixCats the home.nix file :
{} :
{
home.username = "axelb";
# ... your config
nixCats = {
enable = true;
packageNames = [ "nixCats" "regularCats" ];
};
}Rebuild your config:
sudo nixos-rebuild switchProgram nixCats should be available, it uses tne lua config as you have last built it with nixos-rebuild.
$ nixCats
# opens neovim with example configProgram regularCats is impure and will use external lua config as defined in catsnvim flake. By default, it looks for nixCats-nvim directorty inside ~/.config, ~/.local, etc. You can create a symlink between catsnvim directory, so that it loads the latest state of your lua config, e.g. for testing purpose.
ln -s <CATSNVIM DIRECTORY> ~/.config/nixCats-nvim