I would just go buy a solar usb charger and rig it up in series with the cells. The charger would not put out enough juice to fry any batteries. Since nimh batteries naturally dwell at 1.2 volts, they would float at 1.25 per cell in theory. If one battery hogs more volts, it won't hurt the others.
$15 from Hong Kong
USB 3W 550mAh Solar Panel Mobile Electric Source Power Charger for iPhone 5S 5c | eBay
For a few bucks more, you could just ditch the D-cell batteries and get a power bank widget to plug into the motor:
$30 from USA
10000mAh USB Solar Power Bank Charger for iPhone iPad iPod Samsung i9300 N7100 | eBay