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

[solved] nix build error: 'infinite recursion encountered' #127

Open
Ziqi-Yang opened this issue Apr 6, 2024 · 3 comments
Open

[solved] nix build error: 'infinite recursion encountered' #127

Ziqi-Yang opened this issue Apr 6, 2024 · 3 comments

Comments

@Ziqi-Yang
Copy link

Ziqi-Yang commented Apr 6, 2024

⬇️⬇️⬇️ Find the workaround for this issue in the comment below ⬇️⬇️⬇️

Command: sudo nixos-rebuild switch --show-trace
Here is the error text: https://paste.sr.ht/~meow_king/213fa6661d111fdb8df3f724ed221d81ced8845f


My configuration:

  imports = [
    ./centerpiece_config.nix
  ];

And here is the content of centerpiece_config.nix:

{ inputs, lib, config, pkgs, ...}:
{
  imports = [
    inputs.centerpiece.hmModules."x86_64-linux".default
  ];
  programs.centerpiece = {
    enable = true;
  };
}
@a-kenji
Copy link
Collaborator

a-kenji commented Apr 6, 2024

Thanks for reaching out!

Can you show a little more about how you import the configuration?

@Ziqi-Yang
Copy link
Author

Ziqi-Yang commented Apr 6, 2024

@friedow
Copy link
Owner

friedow commented Jul 27, 2024

⬇️⬇️⬇️ WORKAROUND ⬇️⬇️⬇️

We have had this happen a couple of times now. The problem is that the centerpiece module is imported in a long chain of imports. Nix seems to have an internal threshhold of import calls after which the evaluation is terminated with 'infinite recursion encountered'.

The workaround for this issue is pulling the centerpiecemodule import higher up in the import chain. For starters, try importing the centerpiece module directly in your flake. If that works, push it down one level after another ;).

@friedow friedow pinned this issue Jul 27, 2024
@friedow friedow changed the title nix build error: 'infinite recursion encountered' [workaround available] nix build error: 'infinite recursion encountered' Jul 27, 2024
@friedow friedow changed the title [workaround available] nix build error: 'infinite recursion encountered' nix build error: 'infinite recursion encountered' Jul 27, 2024
@friedow friedow changed the title nix build error: 'infinite recursion encountered' [solved] nix build error: 'infinite recursion encountered' Jul 27, 2024
@a-kenji a-kenji unpinned this issue Sep 26, 2024
@a-kenji a-kenji pinned this issue Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants