Nexus 4 or Moto X

I've been wracking my brain for the past few weeks wondering what phone I should get. Since the Nexus 4 came out I've always wanted one but with the announcement of the Moto X I'm not sure anymore. I love the small form factor that the Moto X is supposed to tote but when it comes down the specs I just can't decide which would be a better buy. The camera is pretty important to me too, same with the battery life. Does one have more advantages than the other? Help!