Updating NixOS: Difference between revisions
rm numbers |
Add information about nixos-rebuild boot a tip to fix a hang during update |
||
| Line 20: | Line 20: | ||
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="bash"> | 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="bash"> | ||
sudo nixos-rebuild switch --upgrade | sudo nixos-rebuild switch --upgrade | ||
</syntaxhighlight>If you want to apply configuration changes and new package updates after rebooting the system, use the following command instead:<syntaxhighlight lang="bash"> | |||
sudo nixos-rebuild boot --upgrade | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 35: | Line 37: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Limiting the maximum number of running jobs == | |||
Sometimes, the update process may hang when the system CPU has a high number of cores. You can limit the maximum number of running jobs. | |||
Command:<syntaxhighlight lang="bash"> | |||
sudo nixos-rebuild switch --option max-jobs 8 | |||
</syntaxhighlight>configuration.nix<syntaxhighlight lang="nix"> | |||
nix = { | |||
settings = { | |||
max-jobs = 8; | |||
}; | |||
}; | |||
</syntaxhighlight> | |||
[[Category:NixOS]] | [[Category:NixOS]] | ||