The wiki is an unofficial dumping ground of random information that is barely maintained. Follow the official home-manager docs @Kyle linked.
You can grab nix repos with fetchTarball
, but:
- In this case
fetchFromGitHub
would be more appropriate
- Updating is tedious, so users don’t, hence it should not be recommended
- If you use a different method for grabbing nixpkgs (and you probably do, because there are many better alternatives, with channels being the default), the update process is different from the rest of your update process, which exacerbates the above
- It’s easy to forget/not know that you should specify a hash, which will make you update every time you re-evaluate your config and the cache TTL has lapsed (so ~hourly)
Doesn’t mean you can’t use a fetch*
to download home-manager if you know what you’re doing, but if you did you wouldn’t be asking how to do it.
Use flakes, channels or niv. If you’re a newbie still struggling with basics, channels should probably be recommended at the moment, so you don’t have to fight the schism between official manuals and stuff written by the larger community as much initially.
The wiki probably recommends this because there is a subset of users who:
- Don’t like channels (most of us don’t like them, but they’re status quo)
- They’re also a bit harder to document for, because you can’t just dump code and need to give CLI instructions
- Think niv is a pointless abstraction over manually managing
fetch*
- Don’t like flakes (they’re still controversial for a variety of reasons)
That, or the article was written before the alternatives had sufficient mindshare to be considered, and has not been significantly refactored since.
This one is more subjective, but using the NixOS module significantly reduces the amount of learning you need to do, since it doesn’t introduce a wholly separate command to learn to use (and separate installation to maintain).
I’d therefore recommend it to new users who want to manage home configuration in a NixOS system, there’s enough stuff to learn as-is, you can consider making things standalone when you’re more comfortable.
Even then I don’t recommend having a standalone home-manager on NixOS, frankly, unless you have a specific use case. It’s just easier to control it with one command.
It’s for when you want to use home-manager standalone on NixOS. You can still follow the method recommended by the home-manager docs, but I think using the home-manager command installed by that package is preferable because it is always guaranteed to work with the version of nixpkgs you have.
Either way, I still think that a user who does not understand the difference between this standalone method and the standalone method from the home-manager docs should steer clear of both initially. Using the NixOS module is easier and clearer, until you have a very specific use case.