Kotlin extensions functions provided by own Gradle Plugin

I’m writing Gradle plugin in Kotlin and I’m looking for a way how to extend some existing object. For example Android specific one

fun ProductFlavor.setSignKey(remoteSignKeyName: RemoteSignKeyName) {
    this.extra["signKeyName"] = remoteSignKeyName
}

It is technologically possible because project.extensions.create do exactly the same thing, but just for Project object.

Is it somehow possible to the same with other objects?

I found a promising way here

but I did not found a way how to make it working with .gradle.kts in my plugin project.
Do you know about some example of this?