All you have to do is take a rest.
Take a rest = X.
[All you have to do is X] = X is [what] you have to do.
“[what] you have to do” is a noun phrase.
In the original form, the grammatical subject is “All you have to do” which is a shortened form of “All of the things that you have to do” or something similar (in deep structure).
“Is” is next to “take” because the infinitive “to” has been deleted. You could also say ( and the deep structure form of the sentence would be) “All that you have to do is to take a rest.” Infinitives often act as nouns or noun-like things: “To eat 15 hotdogs in one minute is difficult.” “To err is human”…etc. etc.
Gosh, that’s about all I got out of my required morphology/syntax classes, sad to say.