Files
LogSeq/logseq/bak/pages/Tech/NixOS/Recover from `nixos-rebuild test` without a reboot/2025-08-02T12_38_58.849Z.android.md
2025-12-11 06:26:12 -08:00

882 B

created, tags, source, author
created tags source author
2024-01-26T15:43:17 (UTC -05:00)
nixos
https://serverfault.com/questions/890886/recover-from-nixos-rebuild-test-without-a-reboot aij 20311 silver badge77 bronze badges

Recover from nixos-rebuild test without a reboot - Server Fault

Excerpt

Is there a way to revert to the previous (or at least "current") configuration after nixos-rebuild test without rebooting?

Per the nixos-rebuild manual:

test Build and activate the new


# List previous generations
sudo nix-env --list-generations -p /nix/var/nix/profiles/system

# Live switch to any generation
sudo nix-env --switch-generation 12345 -p /nix/var/nix/profiles/system
sudo /nix/var/nix/profiles/system/bin/switch-to-configuration switch

Source: https://github.com/NixOS/nixpkgs/issues/24374