This is a direct conversion, the API change is simple:

Previously:

$mail_systems = variable_get('mail_system', array('default-system' => 'DefaultMailSystem'));
$mail_systems['default-system'] = 'NewMailSystem';
variable_set($mail_systems);

Now:

$mail_systems = config_get('system.mail');
config_set('system.mail', 'default-system', 'NewMailSystem');
Introduced in branch: 
1.0.x
Introduced in version: 
1.0.0
Impacts: 
Module developers