How do I build floating shelves in a nook with a mirror behind it?
You could mount support bars on the walls that touch the ends of the shelves. The bars should be screwed into studs that form the framing of the inset walls. Square tubing, either aluminum or steel would do well.

The shelves would need to be fairly thick.  They would have a slot (dado) cut into in the middle of the end edges, slightly wider that the thickness of the support bars. The front edge of the shelf could have a strip of matching wood glued to its face, hiding the slot. The remaining edge of the shelf, especially the top edge, should be substantial, preferably at least 1/2"



An alternative would be to use an angle iron instead of a bar. This would allow a thinner slot.

A blind mounting system on the sides only would allow you to mirror the whole wall. This assumes that the span of the shelf is not too long and there is not too much weight on it.  If the support bars (or angle irons) and shelves are solid, you probably could go up to 30" without too much problem