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

Warn users of the infinite recursion bug in home-manager. #25

Closed
nikp123 opened this issue Dec 21, 2023 · 4 comments
Closed

Warn users of the infinite recursion bug in home-manager. #25

nikp123 opened this issue Dec 21, 2023 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@nikp123
Copy link

nikp123 commented Dec 21, 2023

Basically when importing an home-manager module outside of where you imported home-manager itself, you'll experience something like akin to this:
GermanBread/declarative-flatpak#9

I know that some people will run into this exact same issue, so it's better to warn them instead of leaving them with a confusing message.

@gmodena
Copy link
Owner

gmodena commented Dec 23, 2023

hey @nikp123 . Thanks for the heads up. I did not stumbled upon this bug yet.

I'll have a link to the issue your linked and try to reproduce. Do you maybe have a snippet with a buggy nix-flatpak config? Though it might be a more general home-manager thing.

@nikp123
Copy link
Author

nikp123 commented Dec 24, 2023

hey @nikp123 . Thanks for the heads up. I did not stumbled upon this bug yet.

I'll have a link to the issue your linked and try to reproduce. Do you maybe have a snippet with a buggy nix-flatpak config? Though it might be a more general home-manager thing.

IIRC, it's a home-manager thing. Apparently importing home-manager modules is scope specific due to a bug. IMO it's better to inform, just in case.

To reproduce the issue, you'll have to:

  1. put this or any other flake home-manager module as a flake input
  2. import your home-manager instance in a (example) home.nix file
  3. in that home.nix file you will import a file (example) home-subconfig.nix
  4. and in that file you'll import this or any other home-manager module. This fails.

@nikp123
Copy link
Author

nikp123 commented Dec 24, 2023

Here's the original issue in case you haven't found it: nix-community/nixvim#83

gmodena added a commit that referenced this issue Jan 3, 2024
Add a known issues section.
Inform of infinite recursion import bug
reported in #25.
@gmodena
Copy link
Owner

gmodena commented Jan 3, 2024

IIRC, it's a home-manager thing. Apparently importing home-manager modules is scope specific due to a bug. IMO it's better to inform, just in case.

To reproduce the issue, you'll have to:

1. put this or any other flake home-manager module as a flake input

2. import your home-manager instance in a (example) `home.nix` file

3. in that `home.nix` file you will import a file (example) `home-subconfig.nix`

4. and in that file you'll import this or any other home-manager module. **This fails.**

hey @nikp123, thanks for this. I was able to reproduce. As far as I can tell, nesting hm imports results in circular dependencies that breaks with an infinite recursion.

I added a warning to the README, hope this helps.

Let's keep this issue open as a way to further document workarounds / fixes.

gmodena added a commit that referenced this issue Jan 4, 2024
* README: inform of hm import bug.

Add a known issues section.
Inform of infinite recursion import bug
reported in #25.

* README: fix wording
@gmodena gmodena added the documentation Improvements or additions to documentation label Feb 17, 2024
@gmodena gmodena closed this as completed Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants