Yes, there is. It's called making a Nandroid backup.
The complete steps are outlined here, but before you even proceed, you'll need to root your phone. You can't do this without rooting. Rooting is the process of gaining superuser access on your phone.
Since you have a Google Nexus 5, you should read the instructions for rooting it available over here and here.
After you have rooted your phone, you might want to install a custom recovery tool like ClockworkMod Recovery or TWRP.
After you've completed both those steps (got root, installed a custom recovery), all you need to do it reboot your device into recovery mode and perform the Nandroid backup.
UPDATE: To restore the backup on your new phone you'll need to root it as well. And install a custom recovery too. After that, you can boot into recovery mode and restore the nandroid backup.