Default Build own rom for Nexus 5

How do I build my own custom ROM for my Nexus 5?
Devices: Nexus 5 (Sold) 1X
Nexus 5
HTC One