Green’s Dictionary of Slang

nuts n.1

[‘Prob. ex C.16 nuts to, an enticement to’ (DSUE)]

1. [17C–1920s] anything agreeable, satisfactory, an acceptable situation; usu. as nuts for/to a person.

2. [1930s+] (US) the nuts, a strategic advantage, esp. in gambling, as in a winning hand in cards.

In phrases

for nuts (adv.) [the relative insignifance of a nut]

[late 19C+] at all, in no way, e.g. she can’t cook for nuts.