Misterio77 / nix-colors

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

Infinite recursion on nix-colors.homeManagerModule import #11

Closed marcosrdac closed 2 years ago

marcosrdac commented 2 years ago

Good evening, @Misterio77,

After adding nix-colors to my home-manager flake inputs in

inputs = {
  # ...
  nix-colors.url = "github:misterio77/nix-colors";
};

Then trying to import nix-colors' home manager module with

{ config, pkgs, nix-colors, ... }: {
  # ...
  imports = [
    # ...
    nix-colors.homeManagerModule
  ];
}

I end up with a infinite recursion module:

+/nixpkgs$ hms
warning: Git tree '/home/marcosrdac/.config/nixpkgs' is dirty
error: infinite recursion encountered

       at /nix/store/s6wigis38dnikj5y92jrrj7ywc38b78g-source/lib/modules.nix:365:28:

          364|         builtins.addErrorContext (context name)
          365|           (args.${name} or config._module.args.${name})
             |                            ^
          366|       ) (lib.functionArgs f);
(use '--show-trace' to show detailed location information)

When I remove the imports part, my configs start working again. Do you have any idea why it could be happening? My home-manager config are here, if it happens to matter.

Thank you beforehand for your attention!

Misterio77 commented 2 years ago

Hey!

The error message is a little misleading. The problem is inputs aren't automatically passed onto your nixos/home configurations. You gotta use specialArgs (when dealing with nixosConfigurations) or extraSpecialArgs (for homeConfigurations).

Here's a quick patch that should(tm) fix it: https://github.com/marcosrdac/nixpkgs/pull/1

marcosrdac commented 2 years ago

You got it. I was wrong thinking that every input was passed to home-manager imports.

Also, thanks for your PR, that was very kind :)