I havent used nixos much but I dont understand why people use home manager instead of just the configuration.nix.
Is the only reason using it to not have system wide package installed? Does it have other usecases too?
Modules that enable dotfile configuration / management. I only use my system configuration for services and host-wide packages. I keep all my normal user programs in home-manager. My flake lets me easily switch each host between using the home-manager nixos module, or using standalone for rebuilding home independent of the system (without sudo). I have very elaborate librewolf and mpv configurations. The latter I actually switched off of home-manager’s mpv module; now I use a wrapper that packages mpv with my config for it, output as a consumable package. That works for some things, but customizing Firefox/librewolf without the module would be a pain in the ass. It also means I can use my home configurations on non-nixos distros (tho, I haven’t had the need)
I don’t have to use
sudo(and thus type in my password) when I want to install programs/modify app configs when I use home-manager bc it’s per-user. The system config modifies the entire system even if the only changes affect a single user, so will always require usingsudoto make the changesthat makes sense, thanks
I usually install as much as reasonably possible on the user level because it’s more portable. I mostly use it for installing packages though, i don’t manage my dotfiles with it because i have things like theme switching scripts that rely on editing the symlinked files, and home manager symlinks from the nix store which is read-only. I just have a simple bash script that does the symlinking.
You can use it in other Linux distros that has nix package support. Also user level isolation, and you know stuff you’re installing aren’t going to change something deep in the system.
Home manager also has a module for most popular software so you can directly configure them in nix, like
programs.yazi = { enable = true;
config = { Some stuff };
Also stuff like enablefishintegration = true; };
Often more convenient than writing dotfiles and referring to them.
My work laptop is Ubuntu, I can’t change the OS but I can have the exact same user packages and config across all of my systems with it.
It does things the system nix cannot: manage your users config. I use it instead of a dotfile manager as it combines that with being able to install packages.
I have seen people sharing their home configuration on github. good usecase
My main PC uses Mint instead of NixOS. Likewise, when I was working those PCs used Mint/Ubuntu. It’s nice being able to have my config on those systems.





