Drush site-install and extra settings for the settings file? We are developing a site with a make file, profile and drush-si.
Thus far it's great, but i cant find a way how to add some slightly more complex settings to the settings.php file. For the beginning, base_url and second database would be totally enough :). Memcache and proxy are other candidates.

Or is this something that could be done in an installation profile ? Where ?
Checkout the post about Collecting and writing configuration settings to setting.php from an install profile.

It describes how a custom task was injected into the installation profile and then details how drupal_rewrite_settings() was used to inject the custom settings into settings.php.