Catalyzes the sulfuryl group transfer from 3'-phosphoadenosine-5'-phosphosulfate (PAPS) to trehalose, leading to trehalose-2-sulfate (T2S). The sulfation of trehalose is the first step in the biosynthesis of sulfolipid-1 (SL-1), a major cell wall glycolipid and the most abundant sulfated metabolite found in Mycobacterium tuberculosis, that is a potential virulence factor thought to mediate host-pathogen interactions. 3'-phosphoadenylyl sulfate + alpha,alpha-trehalose = 2-O-sulfo-alpha,alpha-trehalose + adenosine 3',5'-bisphosphate + H(+) Glycolipid metabolism. Homodimer. Loss of T2S and SL-1 formation. Unsulfated acylated precursors of SL-1 are not detected, which indicates that Stf0 acts before lipid addition to trehalose. Belongs to the Stf0 sulfotransferase family.