-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Feature Request: rollback
command
#1114
Comments
Thank you for your contribution! I marked this issue as stale due to inactivity. If this remains inactive for another 7 days, I will close this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesIf you have nothing of substance to add, please refrain from commenting and allow the bot close the issue. Also, don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen--nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
Still relevant |
Thank you for your contribution! I marked this issue as stale due to inactivity. If this remains inactive for another 7 days, I will close this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesIf you have nothing of substance to add, please refrain from commenting and allow the bot close the issue. Also, don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen--nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
home-manager has been lacking a |
I don't think there is any particular technical difficulty if one implement rollback by simply running an old activation script. This is the method suggested in the readme.
The simple solution is not ideal, though, since it will create a new generation that effectively is a duplicate of the target generation. Ideally it would be possible to reuse the target generation by switching the "current generation link" to the target generation. To do this one would have to do various changes in the activation script.
In any case, I think the reason why it hasn't been implemented is simply that nobody has had the time, knowledge, and motivation to do it. I don't really use rollbacks so it hasn't been a priority for me.
|
@rycee Thanks for helping me understanding it! |
Feedback on how rollback is going:
Any suggestions? I was able to roll back the main OS but home-manager is stuck in the future. Would it be a really bad idea to run that activate script as sudo (where things are not messed up because nixos rolled back nicely)? |
(I managed to fix the underlying issue so I could roll forwards. Not being able to roll back is concerning, but I do understand that glibc is pretty essential.) |
There is a dedicated section in home-manager manual about rollbacks. Here is a command I frequently use to rollback home manager like grub menu nixos rollbacks. bash $(home-manager generations | fzf | awk -F '-> ' '{print $2 "/activate"}') This assumes you didn't nuke your bash, fzf, home-manager and awk programs. Most of the time only my desktop environment or terminal is nuked so I find it quite useful. I save it as a simple script in ~/.local/bin. |
Will be resolved once #4976 (or similar) gets merged. |
It wasn't immediately obvious that you have to use the
activate
script in a generation's folder, but I feel like with arollback
command that takes a generation id that would be immediately obvious if one does a--help
orman home-manager
. Given that we already have a means to get from the id to the nix store generation path this should hopefully be trivial. The README also hints at a feature like this by saying it doesn't exist, but I don't see any issues for it (with my searching).The text was updated successfully, but these errors were encountered: