Skip to content
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

Open
Shou opened this issue Mar 25, 2020 · 10 comments
Open

Feature Request: rollback command #1114

Shou opened this issue Mar 25, 2020 · 10 comments
Labels
pinned Prevent marking as stale

Comments

@Shou
Copy link

Shou commented Mar 25, 2020

It wasn't immediately obvious that you have to use the activate script in a generation's folder, but I feel like with a rollback command that takes a generation id that would be immediately obvious if one does a --help or man 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).

@stale
Copy link

stale bot commented Apr 29, 2021

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 this is resolved, please consider closing it so that the maintainers know not to focus on this.
  • If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

  • If you are also experiencing this issue, please add details of your situation to help with the debugging process.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

If 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.

@stale stale bot added the status: stale label Apr 29, 2021
@stale stale bot closed this as completed May 6, 2021
@berbiche berbiche reopened this May 6, 2021
@stale stale bot removed the status: stale label May 6, 2021
@berbiche
Copy link
Member

berbiche commented May 6, 2021

Still relevant

@stale
Copy link

stale bot commented Aug 4, 2021

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 this is resolved, please consider closing it so that the maintainers know not to focus on this.
  • If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

  • If you are also experiencing this issue, please add details of your situation to help with the debugging process.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

If 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.

@stale stale bot added the status: stale label Aug 4, 2021
@sumnerevans sumnerevans added the pinned Prevent marking as stale label Aug 7, 2021
@stale stale bot removed the status: stale label Aug 7, 2021
@leira
Copy link

leira commented Oct 8, 2021

home-manager has been lacking a rollback feature for many years. I just want to understand what is the technical difficulty to have a rollback command?

@rycee
Copy link
Member

rycee commented Oct 8, 2021 via email

@leira
Copy link

leira commented Oct 10, 2021

@rycee Thanks for helping me understanding it!

@gilescope
Copy link

Feedback on how rollback is going:
just tried a rollback as the future used a newer glibc 2.34 that people are not all ready for on unstable.. but

/nix/store/yzcds1xs8zm52dsgiw4nh2h44k96qq0b-home-manager-generation/activate
Starting home manager activation
nix-build: /nix/store/q29bwjibv9gi9n86203s38n0577w09sx-glibc-2.33-117/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/psijdi9190zgbp053y6dj3ax4y2l70gk-gcc-11.2.0-lib/lib/libstdc++.so.6)

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)?

@gilescope
Copy link

(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.)

@hakan-demirli
Copy link

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.

@rycee
Copy link
Member

rycee commented Apr 21, 2024

Will be resolved once #4976 (or similar) gets merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pinned Prevent marking as stale
Projects
None yet
Development

No branches or pull requests

7 participants