nixos-and-flakes-book/docs/nixos-with-flakes/update-the-system.md
2023-07-04 13:56:18 +08:00

467 B

Updating the System

With Flakes, updating the system is straightforward. Simply execute the following commands in /etc/nixos or any other location where you keep the configuration:

# Update flake.lock
nix flake update

# Apply the updates
sudo nixos-rebuild switch --flake .

Occasionally, you may encounter a "sha256 mismatch" error when running nixos-rebuild switch. This error can be resolved by updating flake.lock using nix flake update.