The Android 5.0 Lollipop glue has not even set on the Nexus 5 yet, but there is already an exploit out to provide you with beautiful root privileges. Here's how to root the Nexus 5 on Android 5.0 Lollipop. Update: I've added the modified kernel boot image to the instructions below. Apologies for any confusion.
Nexus 5 tips and tricks
How to turn your Nexus 5 into a Nexus 6
Note: This procedure wipes all data from your device, so make a backup before you get started. Also, as with all root-related processes, there are inherent risks involved. Make sure you are OK with them before proceeding, as neither AndroidPIT not myself assume any responsibility for nasty eventuations that occur through your indulgence in the directives forthcoming. This tutorial is for the Nexus 5 with an unlocked bootloader running stock Android 5.0 Lollipop (build number LRX21O).
How to root Nexus 5 on Android 5.0 Lollipop
1. Make sure your phone has USB Debugging enabled in Developer Options. If you don't have this option in Settings already, go to Settings > About Phone and tap Build Number until the notification that Developer Options have been enabled pops up. Then back out a step and you'll see it at the bottom of your Settings menu.
7. Copy the SuperSU zip file to the root directory of your Nexus 5 (temporarily turn off USB Debugging if your PC doesn't recognize your Nexus 5 is connected). To do this, connect your Nexus 5 to your PC with a USB cable and copy the file to the place where all the root folders are: not in a folder.
13. You'll now be rocking ClockworkMod recovery. Next you want to enter the following ADB comand:
fastboot flash boot boot.img
14. And now you'll be rocking the modified boot image with custom kernel. Use the volume keys to select Recovery Mode on your Nexus 5 and hit Power to enter it.
15. From CWM, use the volume keys to select ''install zip'' and hit Power to confirm, then select ''choose zip from SD card'' – no prizes for guessing what comes next.
16. Locate the SuperSU zip you copied over earlier (it should appear at the bottom of the list in /sdcard/0/) and press power to confirm your selection, reconfirm and wait until you see the notification at the bottom of the screen that says ''Install from SD card complete''.
17. Back out to the main menu and reboot your Nexus 5. make sure you tell SuperSU to fix root!
18. The first boot may take ages (this is why you charged your battery) – don't freak out. Go have a cup of tea and let it do its thing. Do NOT unplug your phone from your PC or winged monkeys will fly through the window and do all kinds of terrible things to you.
19. Once your Nexus 5 has rebooted, that's it. You're rooted and ready to roll with SuperSU installed. Install RootChecker from the Play Store to double check your root status and grant it superuser access. If you get a green confirmation message you're all sorted.
20. If you get stuck in a bootloop (meaning after a long time your phone still hasn't booted up normally), you can switch it off, reboot into Fastboot, go to Recovery and wipe data, wipe cache partition and reboot again. That should do the trick.