-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List-generations and rollback to any configuration #24374
Comments
#24280 is a bit related. Strange part is |
there is a -T missing so ln will not resolve the target as a folder |
This would still be really nice to have |
Yes this would be a nice feature |
You can list system generations with this: sudo nix-env --list-generations --profile /nix/var/nix/profiles/system |
@thanegill awesome, thank you! Is it possible to list a bit more information like NixOS channel of the generation and Kernel version like it's shown in the bootloader? Edit: Found a way.
These nix store paths then contain a |
Thank you for your contributions.
|
I'd still like to see a way to switch between existing generations. Last night I had to get back to a generation associated to a different profile and what I had to do was build a new generation of that profile and then rollback over and over until I reached the desired one. That was not a smooth experience. |
I would love to be able to revert to absolute generations (e.g. |
Is there a technical challenge in getting that implemented, anyone knows? |
I took a short look into the code and as far as I can see, |
I have just implemented an untested version and I will try it out tomorrow or so. Be carefull if you use it - it was just done by copying the |
Seems to work :) sudo nix-env --switch-generation 12345 -p /nix/var/nix/profiles/system
sudo /nix/var/nix/profiles/system/bin/switch-to-configuration switch (Replace the |
I added |
I marked this as stale due to inactivity. → More info |
Is anyone here in for a review of #105910? |
For those looking for a way to do this now:
This sets the current generation as the active one, with the advantage that you've just tested it's bootable. via: https://www.reddit.com/r/NixOS/comments/ni9u5l/nixos_rollback_questions/ Added to wiki: https://nixos.wiki/wiki/NixOS#Generations |
I marked this as stale due to inactivity. → More info |
Also to list generations.
Thank you. This fix works with a headless system. Until this is implemented officially, I will have to put these commands in a script. |
Also it would be great if |
Use this to boot to a previous generation. Replace 28 with your generation.
|
Didn't work for me for some reason. It said it did switch, but I still saw a newer version from the last profile. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/docker-run-and-docker-exec-error/30848/4 |
Issue description
I'd like to
nixos-rebuild switch --rollback
system to an old configuration, but current interface allows rollback only to previous one.In NixOps, for-example, you can specify the generation number you'd like to rollback to. The generations and their numbers are shown with
nixops list-generations
Doing things manually show an error:
Technical details
The text was updated successfully, but these errors were encountered: