I’d like to set a “global” option from within a submodule, but the config
I return is grafted into the “global” under the submodule “path” rather than at the root… any idea if it’s somehow possible?
Er… I guess I didn’t make a great job at explaining what I want to do… Some code will hopefully help.
In mymodule.nix
I have:
{ lib, config, ... }: {
options.myoption = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule (
import ./mysubmodule.nix
));
};
}
and mysubmodule.nix
is:
{ name, lib, config, ... }: {
options.mysubmoduleoption = {
type = lib.types.str;
};
config = {
# here I want to set a "global" option, say "systemd.mounts"
# based on the value of "mymodule.name.mysubmoduleoption"
# but it seems I can only set values under "mymodule.name"
};
}
You must log in or # to comment.