divnix / digga

A flake utility library to craft shell-, home-, and hosts- environments.

Home Page:https://digga.divnix.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infinite recursion encountered when using Stylix

robertodr opened this issue · comments

I've been trying to update my flake setup to use the latest version of stylix, but I keep hitting an infinite recursion:

error: infinite recursion encountered

       at /nix/store/f6jk9gi6i92ngcbkcz8z2d7gvkksciw1-source/lib/modules.nix:728:9:

          727|     in warnDeprecation opt //
          728|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          729|         inherit (res.defsFinal') highestPrio;
(use '--show-trace' to show detailed location information)

Using --show-trace doesn't help much in finding the reason unfortunately.
This is the latest revision of stylix that works for me: d7536947a7fc3f9b60ba3c8f19c2530ca00110a9. I'm using digga to structure my configuration (you can find it here) I define the theme in this file which I then import in the definition of the user

The Stylix maintainers did some investigations: danth/stylix#43 (comment) I'm not sure whether this is something that should be fixed in stylix or in digga though.

My hypothesis is that the lib argument you use in the module system comes from the pkgs argument that is created from the nixpkgs.pkgs and nixpkgs.overlays options. As such, setting nixpkgs.overlays under a mkIf that is taken from lib will always result in an infinite recursion. I think it would be better if lib wasn't included in this fixpoint, but if it isn't that would means that overlays can't extend it.