Cheap, dimmable, controllable lighting? You can go pretty cheap here, unless you want to be able to control the color temperature of the lights.
Two Beamswork DA FSpecs (or other budget LED strip) both hooked up to a TC420 controller (or each hooked up to their own S2-Pro controller, which are less flexible than the TC420 but the wiring is easier) is what I'd do. If you want to go with a single light fixture for a cleaner look (not a bad idea if you go for a fancy rimless tank), look into a Chihiros LED or other higher-par strip, and attach a controller to it. Make sure you research that the controller you choose is compatible with the fixture you choose. I have tested the TC420 and the S2-Pro with both a beamswork da-fspec and a nicrew tricolor and they work great.
I'm a fan of separating the LED control aspect from the light fixture. That way you can replace either component separately.
For a 40 gallon tank, pressurized CO2 will end up being easier and cleaner looking, because you can do an inline atomizer/diffuser, and it is convenient to be able to easily change the CO2 rate to meet your needs. But I still do DIY CO2 on a 20 gal, and for a 40 you could do two 2-liter bottles, refill one each week staggered.
I would de-prioritize the auto-doser.