jakehamilton / config

One Nix flake to rule them all.
Other
354 stars 21 forks source link

Claryfying the use of home-manager #16

Open stratosgear opened 8 months ago

stratosgear commented 8 months ago

Do you mind explaining a bit how home-manager is triggered from your setup?

"Usually":

But in your repo just a nixos-rebuild would also trigger the home-manager. I would expect it would at least check the hostname and not trigger it if I build for a different host

At which point is the home-manager triggered? I believe this is a by-product of the snowfall lib, triggering it? I bet if I removed the homes folder I would eliminate the home-manager execution (haven't tried it yet).

A by-product of this "issue" is that I (somehow) managed to get all my zsh to start with a double header of toilet 'Plus Ultra'. Checking the .zshrc I saw that it was sourcing the files twice. No idea how I managed that. Once I removed the zsh and starship configurations from modules/nixos/user the double sourcing got fixed (and back to a single Plus Ultra header in the terminals...

I think you mentioned somewhere that you use case does not involve home-maager too much, as your systems are strictly single user, so maybe this is not a priority for you! But home-manager does make some things easier to configure, so if both could be clearly used this would be great.

This might be similar to #8, especially in regards that home-manager seems to be triggered for ALL hosts.

Once again, thanks.... :)

Dokkae6949 commented 8 months ago

I would also be really interested in the topic on how home manager is supposed to be used. Especially since I see quite a few nixos modules which specify home-manager stuff.. this is a bit confusing because it seems that the nixos modules are used like home modules.

Edit: Another quick example which I'm confused about is why you have some things both in home and nixos modules. Like Git for example.

stratosgear commented 7 months ago

I am no expert and I cannot speak for Jake, so please do not let me confuse you, but I have been playing with the config files and my take so far is this:

Home manager is used strictly as a single user account only, that is why you see the plusultra.home.* invocations in multiple places. They all default to the single user defined in the plusultra.user.name user.

As you mentioned, I would rather not see any home manager invocations while I do my usual nixos-rebuild switch operations that are supposed to be system specific only (and not user/home-manager related). It "might" make sense to merge both system and user operations in a single command, if the systems are strictly single user. But that is not the existing documentation that is out there, and thus our confusion... :)

In regards to setting up git with both nixos and home modules: Setting it up as nixos modules will populate configuration files in the global space (/etc/git/config, I believe) while with home modules they will go to ~/.config/git/config.

Again, I am passing along my understanding so far in case some of this would "click" for you.

I would still want to hear more from Jake though... :)