Help with infinite recursion in a flake

I didn’t. I needed to see the full error to know that it was a missing module arg:

       error: infinite recursion encountered

       at /nix/store/fpivx4sjcp2vk4rp9nhliln5cwcp3kc6-source/lib/modules.nix:520:28:

          519|         addErrorContext (context name)
          520|           (args.${name} or config._module.args.${name})
             |                            ^
          521|       ) (functionArgs f);

and if you look at the line directly before it (in the --show-trace output), it says

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

which means you didn’t pass inputs into the module system.
Since you of course passed it into the NixOS config, to me that indicated that the place that was missing was in the HM config, and to pass module args into HM configs, you need to either use _module.args or home-manager.extraSpecialArgs (and if the former infrecs then you’d have to use the latter).

Again, why are you creating a separate flake here? A single flake can have multiple outputs.

2 Likes

I want it to be in its own repo (when I finish developing it). I want to share this module, as a flake, with other people. I want this flake as a stand-alone thingy.
I am also plannig to submit a PR to Xmobar’s repo, so that user’s of Xmobar will have the option to use a flake.

Solved it! I removed all vestiges of flake-utils from ./nixmobar/flake.nix.

Everything works now as I intended.

Thank you very much to all who replied.