Home-manager equivalent of "apt upgrade"

I have a home-manager install on an ubuntu machine. I want to get the latest updates for all the packages in my config, but after quite a bit of googling I still can’t figure out how to do this really simple task. I can see from the NixOS cheatsheet that sudo nix-channel --update and sudo nixos-rebuild switch is the way to do this on NixOS, but I’m not sure how to do the same for home-manager.

Any help would be greatly appreciated!

Also is there any equivalent cheatsheet for home-manager? It would be immensely helpful.

2 Likes

It depends a bit on how you use home-manager. But the most common way seems to be the imperative way using channels.

There you first update the channel using nix-channel update, then you switch into the new profile using home-manager switch.

7 Likes

There’s more than one way to use home-manager?

1 Like

You can have a standalone with channels, standalone with pinned or as a nixOS module with or without pinning.

And pinning can be achieved in various ways.

Though you will probably use a standalone when you say you are on Ubuntu.

1 Like

Gotcha, this is more confusing than I realized!

1 Like

It’s not really confusing, just different and unfamiliar. In ubuntu it’s usually:

sudo apt-get update
sudo apt-get upgrade

And under the cover, there’s still release channels, it’s usually just not directly interacted with by most users because it’s so closely tied with your system install. And it’s likely impossible to separate the two.

EDIT: grammar

2 Likes

For noobs like me, that is nix-channel --update.

(apologies for replying to a necro thread, but this was the first result from Google when searching for “nix home manager update” so I figure it is worth it)

3 Likes