The Short Version
The core description matches standard biology. In plants, algae, and photosynthetic bacteria such as cyanobacteria, sunlight drives carbon fixation, turning CO2 into carbohydrates including sugars. The main caveat is that bacterial photosynthesis is diverse, so the exact pathway is not identical across all bacteria.