Catalyzes the NAD(P)H-dependent reduction of dihydroxyacetonephosphate (DHAP or glycerone phosphate) to glycerol 1-phosphate (G1P). The G1P thus generated is probably used for the synthesis of phosphoglycerolipids in Gram-positive bacterial species. NAD(+) + sn-glycerol 1-phosphate = dihydroxyacetone phosphate + H(+) + NADH NADP(+) + sn-glycerol 1-phosphate = dihydroxyacetone phosphate + H(+) + NADPH Binds 1 nickel ion per subunit. Homodimer. Belongs to the glycerol-1-phosphate dehydrogenase family.