Saving a field of type 'text_format' as a system setting variable
The following worked for me; the #default_value is expecting a string but the text_format form element is stored as an array.

$barvalue = variable_get('bar', array('value' =&gt; '', 'format' =&gt; NULL));

$form['foo']['bar'] = array(
'#type'     =&gt; 'text_format',
'#title'    =&gt; 'Bar',
'#definition' =&gt; 'Foo Bar',
'#default_value' =&gt; $barvalue['value'],
'#weight'   =&gt; 1,
'#format' =&gt; $barvalue['format'],
'#required' =&gt; FALSE,
);