Rear lights attached to a bag are very sub-optimal.
The standard solution is a Smart Lunar on the seat stay. Some Cateye lights also fit the seat stay.
You can fit one each side for redundancy and to have one steady and one flashing. The R1 is currently a tenner on PlanetX, but they are old tech, known to suffer from water ingress and give up after a few years' all-weather use. The R2 is better, but not immune, and twice the price.