There's really not much room left in the cases of those things so if you're wanting it to sit inside without modding the case you may be out of luck.

But getting a desktop to run off a battery is totally possible. There's an example of someone doing something like that to a Mac Mini here: