Misterio77 / nix-colors

Modules and schemes to make theming with Nix awesome.
GNU General Public License v3.0
465 stars 38 forks source link

Infinite recursion #37

Closed Guekka closed 10 months ago

Guekka commented 1 year ago

Hey. As the others before me #11, I'm encountering the dreaded infinite recursion I know the issue likely comes from my setup. Feel free to close this issue and ignore it

Otherwise, if you want to have a look, here's my config. It should be familiar to you, as I was heavily inspired by yours. I have taken care to pass extraArgs, so I don't think that is the issue.

Trace:

building the system configuration...
error: infinite recursion encountered

       at /nix/store/mmwiiajx1lbly4pqg4zi6ficvjfkszsp-source/lib/modules.nix:483:28:

          482|         builtins.addErrorContext (context name)
          483|           (args.${name} or config._module.args.${name})
             |                            ^
          484|       ) (lib.functionArgs f);

       … while evaluating the module argument `nix-colors' in ":anon-5:anon-1":

       … while evaluating anonymous lambda

Thanks

Misterio77 commented 1 year ago

Hello!

The issue that the argument being passed through extraArgs is inputs, not nix-colors. You can either:

Use inputs in your home file:

{inputs, ...}: {
  imports = [
    ./global
    ./optional/gnome.nix
    ./optional/activitywatch.nix
    ./optional/heroic.nix
    ./optional/jetbrains.nix
    ./optional/ledger.nix
    inputs.nix-colors.homeManagerModules.default
  ];
  colorScheme = inputs.nix-colors.colorSchemes.dracula;
}

Pass inputs's args instead:

{
# ...
  mkHome = host:
    home-manager.lib.homeManagerConfiguration {
      pkgs = nixpkgs.legacyPackages.x86_64-linux;
      extraSpecialArgs = { inherit (self) outputs; } // inputs;
      modules = [
        ./home/edgar/${host}.nix
      ];
    };
# ...
}
Guekka commented 1 year ago

Thanks for that extremely quick answer However, sorry for wasting your time, I should have told I already tried that That's why I find this issue particularly weird

I pushed another commit implementing the first version

Here's the full log. I am still not familiar enough with the language to understand it

Guekka commented 10 months ago

So, I finally found the solution. I was missing extraSpecialArgs in my home-manager configuration when building with nixos-rebuild