What type of electrical box do I use for a hard-wired smoke detector?
I'd use a round plastic cut-in box even though you have access behind. You'll find this much easier in the long run. 

Remember, smokes do not have ground connections, so just splice the grounds with a wire nut or other approved method and fold into the back of the box.

Along the lines of this: