I use NiMH rechargeable AAA batteries in my Planet Bike Superflash taillights. I also have some other cheaper AAA taillights, but I am slowly replacing them with the brighter Superflash taillights. On a bike tour I recharge my NiMH AA and AAA batteries in a USB powered recharger.
You can buy the optional rack bracket for Superflash taillights.
https://www.planetbike.com/store/rear-rack-tail-light-bracket.html
Instead of the bracket, I used the seatstay mount to attach my lights to my rack, but of the two taillights in the photo, one is not a Superflash. A bit of inner tube rubber strip was needed because the rack tubing was thinner than a seatstay.