Something like that might work but I'm probably using a framebag that would get in the way.
You could have an external battery mounted underneath the saddle, like some of the pro teams have on their TT bikes. Not entirely sure how you'd get the cable out - presumably out of the top of the seat post.
Thought the battery would be too long for that?
@Brommers started
London Fixed Gear and Single-Speed is a community of predominantly fixed gear and single-speed cyclists in and around London, UK.
This site is supported almost exclusively by donations. Please consider donating a small amount regularly.
Something like that might work but I'm probably using a framebag that would get in the way.