nixos-rebuild:tldr:e72bb
The command sudo nixos-rebuild switch --rollback
is used in NixOS to revert a system configuration change and roll back to a previous configuration.
Here's a breakdown of the command:
-
sudo
: This is used to execute the command as a superuser or administrator. It may prompt for the password before executing the command. -
nixos-rebuild
: This is a command in NixOS used to manage system configurations. It allows you to build and switch to different system configurations. -
switch
: This is a subcommand ofnixos-rebuild
that performs the actual switch to a new system configuration. -
--rollback
: This flag is used to specify that the switch should be rolled back to a previous system configuration instead of applying a new one. It tells NixOS to revert the changes made during the last system configuration update.
By running this command, NixOS will revert to the previously active system configuration, undoing any changes made during the last update. This can be useful if the new configuration caused issues or if you want to switch back to a known working configuration.