Help to solve an infinite loop caused in a package


I updated ferdium in order to add the support of screensharing on wayland.
The package is built using a generic base located in the package franz (ferdium has common roots with it). In the latter there is a definition of a derivation which is loaded as the function named mkFranzDerivation.

Code can be found here: ferdium: add screenshart support on wayland · aacebedo/nixpkgs@f161e13 · GitHub

So I added an attr named enableWayland in the generic based and an option in the ferdium package. However if I set the attr in the ferdium package like this enableWayland = enableWayland It ends un in an infinite loop as I do not know how to scope the parameter correctly.

What would be the best solution? change the name of the parameter or add something to scope it?

Or avoid rec in favor of passing a function to mkDerivation which has the added benefit of making overrideAttrs able to propagate changes to dependent attributes.

There’s also this:

nix-repl> let a = 1; in (rec { a = a; }).a     
error: infinite recursion encountered

       at «string»:1:26:

            1| let a = 1; in (rec { a = a; }).a
             |                          ^

nix-repl> let a = 1; in (rec { inherit a; }).a

Thank you! I used the inherit keyword and it worked. I prefer to keep the original intent of the maintainer on this aspect so didn’t choose to change the rec