Custom realm as a plugin

Is it possible to develop a custom realm as a Nexus plugin? If so, any pointer how to start would be appreciated.

Thanks,
/Anders