1. Enable Developer Options by heading to Settings > About Phone on your Nexus 5.
2. Tap on Build over and over until the it tells you you are a developer.
3. Tap Back and then Tap Developer Options.
4. Enable USB Debugging.
5. Download and the install the universal USB Drivers.
6. Download the rooting program from the developer’s page here and save it to your desktop (and please donate to the developer if this procedure helped you).
7. Extract the .zip file.
8. Turn off the phone.
9. Turn it back on by holding down Volume Up, Volume Down, and Power at the same time to get to fastboot mode.
10. Plug it in via USB.
11. Double-click the windows-root.bat file.
12. Click More Info and then Run Anyway if prompted.
13. Hit enter to begin the program.
14. Select Yes on the phone screen by tapping Volume Up then Power when prompted.
15. Wait for the program to finish rooting after that and the device will reboot and you’ll have SuperUser in your app drawer.