You leave behind gear sufficient to create a rappel anchor that is strong enough for any conceivable load that may be placed upon it. This is no different from any other properly constructed rappel anchor, the specifics of which vary with the placement and circumstance.
The only situation I can conceive that one would have to violate this rule is in a true emergency where you lack sufficient gear to safely complete the rappel, yet if you remain you have greater risk of death by exposure, fire, etc. Since you are asking about "nuts or worse yet expensive camming devices" this does not appear to be the case you are inquiring about. You value your life more than your SLCDs I hope.
The fact that you are asking this question leads me to believe that you are not sufficiently experienced with building anchors. Also, "Could cord be used as a sling ...?" leads me to believe you are not even familiar with the capability of your gear, and/or you do not know how to use it properly. Please seek professional instruction from a properly certified guide if you have any doubt.