with import ; evalModules { modules = [{ options.foo = mkOption { default = {}; type = with types; let sub = submodule { freeformType = t; options.bar = mkOption { type = str; default = ""; }; }; t = attrsOf (either int sub); in t; }; config.foo.bla.bla = {}; }]; }