Configuring Gradle to use internal mirror instead of internet for everything

I’m using Gradle to build my projects. Those projects must be able to build in the offline environment. I’ve collected all dependencies and installed a webserver with those dependencies in maven2 format. Now I have to configure Gradle to use this webserver instead of trying to reach internet. Also I don’t want to change my projects, I want it to be machine-specific configuration.

With Maven I solved it this way: create file ~/.m2/settings.xml with the following content:

<settings>
  <mirrors>
    <mirror>
      <id>internal-mirror</id>
      <mirrorOf>*</mirrorOf>
      <url>http://192.168.1.20:9123</url>
    </mirror>
  </mirrors>
</settings>

But with Gradle it’s not so easy, especially using new DSL for plugins. I’ve come with the following monstrous configuration, but I’m not sure if it’s enough. I suspect that there must be easier way, but I didn’t find it yet, documentation on this matter seems to be very sparse. So I put the following into ~/.gradle/init.d/repositories.gradle:

initscript {
  gradle.settingsEvaluated { settings ->
    settings.pluginManagement {
      repositories {
        maven {
          url "http://192.168.1.20:9123"
        }
      }
    }
  }
}
allprojects {
  buildscript {
    repositories {
      maven {
        url "http://192.168.1.20:9123"
      }
    }
  }
  repositories {
    maven {
      url "http://192.168.1.20:9123"
    }
  }
}

Is it a proper way to declare mirror for everything?