Chainfire, the developer of popular root tool SuperSU, has released updated tools to allow you to root your Nexus 5 or Nexus 7 running the latest developer preview of Android, however it isn’t exactly for the faint of heart. It requires first flashing a modified Android kernel to your device, and then flashing the SuperSU ZIP file through a custom recovery.
Why is this necessary? The new security protocols in Android 5.0 make this approach necessary, otherwise root simply isn’t achievable. At this point, we’re probably only a few weeks away from a proper launch of the end-user builds of Android L, at which time you’ll have to flash back to a stock image anyway. It’s likely that the root tools will need another update at that point, but until then, this should get you through.