You can wire to the back or up front and use a PEQ.
options for wiring at the back:
-Use a lipo (fits in buffer tube..does not require crane stock or anything)
-crane stock (a stock that fits a battery.. G&P, dboys, CA etc.)
-I personally use a CTR stock(but you can use what ever kind of retractable stock as long as it has a hole at the back) I cut a small hole on the side and run a wire through there..attach a magazine pouch onto the stock and house the battery(large type) inside a magazine shell. Here's a link to how you do it.
I love this configuration. This guy did the same as well
Options for wiring up front:
-PEQ/PEQ15 type of battery box (small type battery only for wiring at the front)
-lipo that fits inside the RAS but you use a KA free float so this may not work so well
For you specific configuration, if you want to wire at the front, i would use a peq15 battery box. But i would highly recommend going with wiring at the back. If your m4 is already then you're good to go! Just follow the instructions on the link! Hope this helps.