But allied senses of nuts involving infatuation or being out of one's normal mind go back at least to the mid-19th century and perhaps (in the former case) to the late 18th century. I suspect that the intertwining meanings of nuts strongly influenced each other, which makes pinning down the exact date of emergence of the "insane" sense of the ... More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.