HTC One Dev Edition or Nexus S4?

I need a good unlocked phone with good hardware and good battery life.

The HTC One has gorgeous hardware but mediocre battery life and okay software.

The Nexus S4 has ugly hardware, great battery life, and amazing software.

What do you think I should go with?