A Universal Method for Self-Assembly of 2D Nanomaterials for Photovoltaic Structures