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

Error when switching profile #5875

Closed
Mikilio opened this issue Sep 20, 2024 · 4 comments
Closed

Error when switching profile #5875

Mikilio opened this issue Sep 20, 2024 · 4 comments

Comments

@Mikilio
Copy link
Contributor

Mikilio commented Sep 20, 2024

https://github.com/nix-community/home-manager/blame/0b052dd8119005c6ba819db48bcc657e48f401b7/modules/systemd-activate.rb#L76
The above line is the cause.
The error message is:

Sep 20 22:40:03 elitebook hm-activate-mikilio[604650]: /nix/store/cfvq85l2vp4wn5v46ccmnzl8zpjsndjj-systemd-activate.rb:76:in `get_services': undefined method `exists?' for class Dir (NoMethodError)
Sep 20 22:40:03 elitebook hm-activate-mikilio[604650]:   services = get_service_files(dir) if dir && Dir.exists?(dir)
Sep 20 22:40:03 elitebook hm-activate-mikilio[604650]:                                                  ^^^^^^^^
Sep 20 22:40:03 elitebook hm-activate-mikilio[604650]: Did you mean?  exist?
Sep 20 22:40:03 elitebook hm-activate-mikilio[604650]:         from /nix/store/cfvq85l2vp4wn5v46ccmnzl8zpjsndjj-systemd-activate.rb:25:in `setup_services'
Sep 20 22:40:03 elitebook hm-activate-mikilio[604650]:         from /nix/store/cfvq85l2vp4wn5v46ccmnzl8zpjsndjj-systemd-activate.rb:216:in `<main>'
Sep 20 22:40:03 elitebook systemd[1]: home-manager-mikilio.service: Main process exited, code=exited, status=1/FAILURE
Sep 20 22:40:03 elitebook systemd[1]: home-manager-mikilio.service: Failed with result 'exit-code'.
Sep 20 22:40:03 elitebook systemd[1]: Failed to start Home Manager environment for mikilio.
Sep 20 22:40:03 elitebook systemd[1]: home-manager-mikilio.service: Consumed 1.367s CPU time, 29.4M memory peak.

I don't really know ruby, but did the function name change?

@rycee
Copy link
Member

rycee commented Sep 21, 2024

Dunno, but yeah seems it's called exist now.

In any case, could you try using sd-switch instead? Like this:

systemd.user.startServices = "sd-switch";

@Mikilio
Copy link
Contributor Author

Mikilio commented Sep 21, 2024

Ok, that seems to work, but that also means that documentation needs to be updated to not imply that true and "sd-switch" are somehow equivalent.

@rycee
Copy link
Member

rycee commented Sep 22, 2024

They should be the same since a while back. Perhaps you haven't updated your HM pin for some time?

I'm also slowly working towards removing the Ruby tool entirely. It's in a branch at the moment but I hope to reasonably soon be ready to merge it: https://github.com/nix-community/home-manager/tree/rycee/default-systemd-start-services

@Mikilio
Copy link
Contributor Author

Mikilio commented Sep 22, 2024

Yes I just happened to update it sometime this week with a scary nix flake update But personally I won't push too hard on the doc. This can be closed imo.

@Mikilio Mikilio closed this as completed Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants