you are viewing a single comment's thread
view the rest of the comments
[–] 5 points 1 year ago (2 children)
nix flake update
nixos-rebuild --switch --flake .

# Just to keep an update history
git add flake.lock
git commit -m "update"

This may seem like too much work, but it guarantees an all-or-nothing procedure. If some package is broken, the entire upgrade process is canceled, and the system remains in the state that it was.

I have had a couple of partial upgrade cases on Arch. It was not fun live booting to repair it, every time this happened.

  • source
  • hideshow 2 child comments
  • [–] 2 points 1 year ago (1 child)

    I've had updates fail on NixOS. A kernel update didn't generate the initramfs and the system wouldn't boot. Booting to a previous generation and reapplying the update fixed it.

    This is very rare, though, and unlike Arch can be fixed without a Live USB.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 1 year ago

    A kernel update didn't generate the initramfs

    This sounds like a bug on Nix configuration, or the kernel build process.

    If NixOS had caught the error, you wouldn't have gotten a faulty generation at all. This is different from pacman/apt/dnf, which will happily continue the upgrade, resulting in a broken system with no easy way to fix it.

  • source
  • parent