The Nexus 5 did not have mainline support while current; it ran a patched kernel like just about every other AOSP/Android build. Mainline support is now being provided by the postmarketOS folks for the Nexus 5, and could be achievable for other devices.