Updating NixOS: Difference between revisions

Pigs (talk | contribs)
m link to channel branches
`
 
Line 21: Line 21:
=== Rebuilding the system after updating channels ===
=== Rebuilding the system after updating channels ===
If you want to not only apply your configuration changes but also update the packages and system environment to the latest versions available from the Nixpkgs repository. This is typically used when you want to ensure you are using the latest versions of your software and system services:<syntaxhighlight lang="console">
If you want to not only apply your configuration changes but also update the packages and system environment to the latest versions available from the Nixpkgs repository. This is typically used when you want to ensure you are using the latest versions of your software and system services:<syntaxhighlight lang="console">
# nixos-rebuild switch --upgrade
# nixos-rebuild switch
</syntaxhighlight>To apply configuration changes and new package updates only '''after''' rebooting the system, use the following command instead:<syntaxhighlight lang="console">
</syntaxhighlight>To apply configuration changes and new package updates only '''after''' rebooting the system, use the following command instead:<syntaxhighlight lang="console">
# nixos-rebuild boot --upgrade
# nixos-rebuild boot
</syntaxhighlight>
</syntaxhighlight>


Line 36: Line 36:
=== Example of a system update ===
=== Example of a system update ===
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
# nix-channel --update && nixos-rebuild switch --upgrade && reboot
# nix-channel --update && nixos-rebuild switch && reboot
</syntaxhighlight>
</syntaxhighlight>