Some confusions about the separation of home-manager and system level

Let us say I want to install a new window manager, for instance sway.

There are two routes to take: Enable it system wide, where you have to deal with less things on your own because most of it is already enabled in the nixpkgs module, or set it up with home-manager where you have to take a few extra steps but have much more customization options.

I am confused on what approach I should take here, clearly not every user on my system should have sway installed by default, so naturally I would say home-manager - but unlike on the system level you have the disadvantage of needing to enable opengl, the xdg-desktop-portals, and so on on your own.
There is also the “bug” with swaylock going on where you would need to set security.pam.services.swaylock = {} on your own to make it work properly.

To mention some more confusing aspects, the Desktop Environments such as GNOME or KDE Plasma can only be enabled with the system-wide options, there is nothing in home-manager for it. So if you wanted to have Plasma only for the user, that would not work out properly.

Also to mention: Audio. It can only be enabled system wide, not in home-manager.

What I want to say with all of this is: You often cannot really draw a line like you would want to, because often times there is ONLY a system wide option but you would like to do it all in home-manager. In my opinion this causes a lot of confusion.

1 Like

Hi @shaniag, and welcome.

Now I’m not an expert, and still learning lots. I view home manager as the way to configure packages, but that doesn’t mean there are no “system wide” configurations. So for example, I may need a package to be enabled as default, but specific user configurations. So maybe clamav is enabled for all, but I may be someone who needs a daily scan, and others weekly.

And I see your point about, for example, audio. I see audio as a machine function (so flakes or nix config is where I would configure it as a capability) and audio options as a user decision (some maybe…if available, with a silly example being default volume) a home-manager style approach. So what I am saying if you have to choose your approach because Nix (and Nixos) doesn’t really force you. A curse and a blessing.

Hope that helps how to think about it, and apologies if I have anything wrong (as I stay I’m still learning) - but I’m sure others will add to the comments!

I agree that confusion arises - I think (and hope others do) that this conversation helps move us all forward…