nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.97k stars 1.8k forks source link

bug: htop removes home-manager link and overwrite its own config file, making next activation fail #4947

Open andrevmatos opened 9 months ago

andrevmatos commented 9 months ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

Since some time, maybe an htop update, made it start removing the home-manager-created symlink to config, and overwrite its own config in place, when you open it and perform any action which would change config.

Before, it'd just complain that it couldn't write the config as it was read-only, and exit.

This causes next home-manager-*.service activation to fail, since there's a file (~/.config/htop/htoprc) where it tries to drop the symlink to store.

I know this isn't an issue with home-manager, but since we want to remain working despite upstream changes, some form of fix could go here.

Maintainer CC

No response

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.7.1-zen1, NixOS, 24.05 (Uakari), 24.05-bleeding.20240123.15ff175`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.19.3`
 - nixpkgs: `/etc/nix/inputs/nixpkgs`
amarshall commented 8 months ago

As a workaround, xdg.configFile."htop/htoprc".force = true. There’s not much precedent, it seems, for doing that by default in HM.

amarshall commented 8 months ago

Relevant upstream change is likely https://github.com/htop-dev/htop/commit/5e8fc97a96dd2dea1aad8c6c4f2e872aede38ead

stale[bot] commented 5 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve 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

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.

9ary commented 4 months ago

As a workaround, xdg.configFile."htop/htoprc".force = true. There’s not much precedent, it seems, for doing that by default in HM.

I'd rather find another way, because I don't want htop to mutate its config behind my back. Upstream maintainers are rather stubborn about this, and considering their general attitude I doubt they would see this as a regression.

Write-protecting ~/.config/htop seems to work, so I think making that a link to the nix store should work as it did before.

stale[bot] commented 4 weeks ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve 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

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.

9ary commented 4 weeks ago

5553 fixes this, would be nice to see it merged...