How to add a class / an enum to settings gradle script on gradle 6.0+?

I want to add an enum called modules with the path of the sub module and some compilation types.

I used to have this in the buildSrc before gradle 6 and it was accessible in the settings.gradle

But from gradle 6.0, settings.gradle is compiled before buildSrc project. I have moved my enum to the settings.gradle, now it is not accessible to other project level gradle scripts.

The behaviour change is outlined in the below release notes.

They suggest to add the enums / classes used in the settings.gradle to the build script closure, but I am not really sure how to do that.