2

Finally figured out how to set up my systems a couple months ago, and have been using them happily ever since, but realized that it's time to update stuff. My NixOS setup involves declarative package management using Home Manager, but completely forgot the basics and wasn't sure if Home Manager would complicate things as the repo only mentions the home-manager tool which I don't have.

1
2

It's in the NixOS manual but it is not spelled out directly and one has to read through the entire II.6 Package Management section; even though my setup is declarative, the crucial part was under II.6.2. Ad-Hoc Package Management (i.e., nix-channel --update). This NixOS discourse thread also helped a lot.

Please note that I'm not trying to disparage the NixOS manual; it is quite excellent, especially with all the latest changes, but for a casual user or for one who is looking for solutions only for common scenarios, it can be less useful. There is also the NixOS Wiki entry but it is still not spelled out in the same order as need below.

Home Manager does not complicate this process (at least, when used declaratively, see my setup), and running 2.a below will take care of everything.

The steps:

  1. sudo nix-channel --update

  2. a. (declarative) sudo nixos-rebuild switch
    b. (ad-hoc) nix-env -u '*'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.