| I never acquainted with types.nix, is there some fundamental reason that either of two freeform submodules couldn't work when left and right have disjoint explicit options?
with import <nixpkgs/lib>;
evalModules {
modules = [
{
options.foo = mkOption {
type =
types.either
(types.submodule {
freeformType = types.attrsOf types.str;
options.marker_a = mkOption {
type = types.str;
};
})
(
types.submodule {
freeformType = types.attrsOf types.str;
options.marker_b = mkOption {
type = types.str;
};
}
);
};
config.foo = {
marker_b = "bar";
};
}
];
}
{ foo = { marker_a = «error: The option `foo.marker_a' was accessed but has no value defined. Try setting
the option.»; marker_b = "bar"; }; }
|