There is nothing stopping you from using GebConfig.groovy for any arbitrary configuration but I personally wouldn't as I find it not a clean solution - you'd be mixing concerns. I wouldn't do it especially as it's relatively easy to roll your own config using the same mechanism Geb is using which is available in core Groovy, namely groovy.util.ConfigSlurper which has support for environment specific configuration.
Rolling your own mechanism would also make it possible for you to have the behaviour you're asking in 3. You could create the following method at the top of your config script:
def propertyOrValue(String propertyName, value) {
System.getProperty(propertyName) ?: value
}
And then you can use it like:
foo {
bar = propertyOrValue('foo.bar', 'buzz')
}
environments {
superDuper {
foo {
bar = propertyOrValue('foo.bar', 'bizz')
}
}
}
If you want to make the propertyOrValue() method reusable because you envisage having multiple configuration scripts then you could create a base script class (extends groovy.lang.Script), use groovy.lang.GroovyShell.parse() together with a custom compiler configuration (as shown by Mr. Haki at
http://mrhaki.blogspot.co.uk/2011/11/groovy-goodness-create-our-own-script.html) to compile and initiate your config script with a custom base class and then pass it to ConfigSlurper.parse(Script).