nixos-and-flakes-book/docs/nixos-with-flakes/update-the-system.md

13 lines
379 B
Markdown
Raw Normal View History

2023-06-28 09:41:46 +00:00
## Updating the System
2023-06-23 12:29:12 +00:00
2023-06-28 09:41:46 +00:00
With Flakes, updating the system is simple. Just run the following commands in `/etc/nixos`:
2023-06-23 12:29:12 +00:00
```shell
2023-06-28 09:41:46 +00:00
# Update flake.lock
2023-06-23 12:29:12 +00:00
nix flake update
2023-06-28 09:41:46 +00:00
# Apply the updates
2023-06-23 12:29:12 +00:00
sudo nixos-rebuild switch
```
2023-06-28 09:41:46 +00:00
Sometimes, you may encounter a sha256 mismatch error when running `nixos-rebuild switch`. This can be resolved by updating `flake.lock` through `nix flake update`.