Describe the bug
For context, moduleType and extendModules duplicate the configuration namespace, but with user-defined modules added.
Extending the configuration more than once makes name throw a duplicate definition error.
Steps To Reproduce
Suppose we have
{ config, moduleType, ... }: {
options.variants = mkOption { type = attrsOf moduleType; };
options.result = mkOption { type = str; };
}
then
variants.foo = { name, ... }: { result = name; }
will result in
variants.foo.result == "foo"
but
variants.foo.variants.bar = { name, ... }: { result = name; }
causes an error because name is redefined in the second level.
Expected behavior
Additional context
Discovered in #176557 matrix module.
This can be solved by defining name in specialArgs, or by making the parameter name configurable (creating PR in a minute).
Notify maintainers
@infinisil
Describe the bug
For context,
moduleTypeandextendModulesduplicate the configuration namespace, but with user-defined modules added.Extending the configuration more than once makes
namethrow a duplicate definition error.Steps To Reproduce
Suppose we have
then
will result in
but
causes an error because
nameis redefined in the second level.Expected behavior
namedoes not throw an error.All names can be used.
Additional context
Discovered in #176557
matrixmodule.This can be solved by defining
namein specialArgs, or by making the parameter name configurable (creating PR in a minute).Notify maintainers
@infinisil