Kaml adds YAML support to kotlinx.serialization.

In libs.versions.toml add

kaml = { module = "com.charleskorn.kaml:kaml", version = "0.53.0" }

and implementation(libs.kaml in build.gradle.kts.

Then in the implementation define a serializable class, for example

@Serializable
data class RepositoryConfiguration(
    val repositories: List<String>,
)

Reading the configuration can be done using

val configuration = Yaml.default.decodeFromString(RepositoryConfiguration.serializer(), configFile.readText())