We've got a couple guides that should help you with this.
If you have a Windows PC, this guide should be all you need. It was written for updating to 4.4.4, but the same steps apply if you want to update to 5.0.1—just make sure to download the newest set of factory images in Step 3.
If you don't have a Windows PC, this guide will be your best bet. It was written for the Nexus 6, but the steps would be almost identical for the Nexus 5. Of course, instead of downloading the Nexus 6 factory images, you'd have to download the Nexus 5 versions from here. And because the Nexus 5 doesn't have forced encryption, you can skip the stuff about the modified boot.img and instead simply use the stock version that is included in the factory images package. Then to re-root, use this version of CF Auto Root.
If you have any more questions, just let me know.