How can i overlay librewolf with firefox settings? | error: infinite recursion encountered

new to nix/os, and i really like the flexibility of firefox home manager module(declarative plugins, policies, userchrome.css etc.) and want to apply it to my browser, librewolf, which doesnt offer all that by default. AFAIK, i somehow can use firefox settings, but when i tried solution from below, i got following error:

error: infinite recursion encountered
       at /nix/store/p893dkrzm5rxvhnqh092prgi1a7dzmcy-source/lib/modules.nix:652:66:
          651|       extraArgs = mapAttrs (
          652|         name: _: addErrorContext (context name) (args.${name} or config._module.args.${name})
             |                                                                  ^
          653|       ) (functionArgs f);

my config is here, if you need to take a look.
I dont really now abt the nix overlays, and would really appreciate getting to know more about them or any other preffered way to do what i want, thanks in advance.

Are you sure you’re hitting that error because of the librewolf module? it seems like something else is going on.

BTW you shouldn’t need that hack anymore, the PR was merged a while ago and is included in the latest release AFAICT.