Closed Saboti closed 2 weeks ago
So, this is the template for home manager.
You can see at the location I linked to, it has inputs.nixCats.homeModule ?
you would use myNixCats.homeModule there
The nixExpressionFlakeOutputs template exports the same items as the main flake template, and you can clone the example flake and explore them in the repl if you get stuck, or explore your own by exporting myNixCats as an output of your system flake :)
the modules are similar to override. They allow you to import from an existing nixCats based configuration, and then modify them on install. Override also does this, but if you are using nixos or home manager, the module fits in nicer :)
Theres also these docs for the module options and hopefully you can see how they map to the normal ones?
If you just want to import the packages from your config in your nixExpressionFlakeOutputs template implementation as-is, I would suggest just putting myNixCats.packages.${pkgs.system}.packagename into your home or system packages lists however, as its less complication.
If you just want to import the packages from your config in your nixExpressionFlakeOutputs template implementation as-is, I would suggest just putting myNixCats.packages.${pkgs.system}.packagename into your home or system packages lists however, as its less complication.
exactly this i have done so far. In my home.packages = with pkgs; [ ... myNixCats.packages.${system}.nvim ];
I have this included.
Sorry, I picked up Nix recently so don't understanding all the concepts :) I always thinking i have to include Module in my HomeManager Config in my flake.nix like:
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs username useremail system; };
users.${username} = { ... }:
with inputs; {
imports = [ ./home-manager catppuccin.homeManagerModules.catppuccin ];
};
};
and than add the Module in the home manager Configuration and config it there. But I see now this is not how it works since the Package and everything has to be build first. I think I just stick to the working Version I have :) Thank you for the explanations.
Now I did understand it. Found a example in another Repo. I had the following Problem:
at /nix/store/x4nlzgz862i6hkjy7r0zwxgdwnkdkcg3-source/home-manager/nixCats-homeModule/default.nix:5:5:
4| imports = [
5| inputs.nixCats.homeModule
| ^
6| ];
this error happend how I defined the Input:
nixCats = {
url = "github:BirdeeHub/nixCats-nvim?dir=nix";
};
Solution: I removed the ?dir=nix
and now its working for me :)
I created a new folder in my home-manager config and put there your homeModule as default.nix with the lua config etc. This folder i included in the import of my main home-manager config.
Hope it's understandable what I have done. No native speaker ;)
So, in the nixCats repo there are 2 flakes.
1, in the nix dir which is used by the 2 starter templates, which outputs JUST the nixCats library and has no dependencies. It does not output packages or modules. Modules need to be based on a package, and this outputs no packages. So no modules.
You import it with dir=nix and use it to make your own configuration, which then outputs its own modules based on itself
The 2 starter templates use this first flake, inside the nix dir, because you are meant to make your own configuration, not import my crappy example one.
Your config based on the default template or the nixExpressionFlakeOutputs template will output all the same things as the flake I listed as #2 above does, and it will import number 1 to do it.
If you want to use the module based on the example configuration, go right ahead, as long as you know that is what is happening
Thank you very much for your patience with my questions :) With the last explanation and some github search I do now understand it.
Found many examples where they use the "wrong" input. I will close the Issue now.
Yeah I know haha, but yeah ultimately its fine, people are free to use it as they wish, its just better the other way IMO :)
I wish I would have done it differently and had the example config in its own repo and had the dependencyless flake that outputs the library here, but it began this way, and gained the other flake later. Plus, its nice to give people something to run out of the box, and the templates hopefully usually guide people correctly
Its also possible people using the main flake have been using it for longer than the other flake has been around and they havent found it yet. That was added in the last 3 or 4 months.
Hi BirdeeHub,
first, I realy like your NixCat work! Already got it to work with the nixExpressionFlakeOutputs.
In Inputs:
included this in my homeManager default.nix:
The Folder nixCats or nixCats-kickstart is in the same folder as the default.nix for Home Manager. In the folder is the default.nix config from the nixExpressionFlakeOutputs.
But i don't understand how to include nixCats as a HomeManager Module which would be my goal :) Any help would be appreciated.
Regards Tobias