A great advantage of Nexus 5 is that you can very easily unlock and relock its bootloader, but there are few disadvantages also. Firstly, unlocking the bootloader will wipe your Nexus 5 completely for security reasons, and secondly though you can relock the bootloader from fastboot, there is no guaranty that it can revert your device to factory state for warranty purpose.
You can solve both these issues with an application called BootUnlocker. With the app, you can unlock and relock your Nexus 5’s bootloader right from your device and without wiping your data. In addition, you can reset the ‘tamper flag’ within the app.
In order to use BootUnlocker, you need root access on your device. Once you gain root access (use an exploit such as TowelRoot for it), install the app from Play Store, run it and tap Unlock/Lock button.
For newbies: It is virtually impossible to flash a custom ROM, install a custom recovery like CWM or TWRP, or apps that require root access without unlocking the bootloader of your Android device (except Samsung Android devices). By unlocking bootloader, anyone with the proper skills can modify and enhance their Android phone.
BootUnlocker can be downloaded free from the Play Store for free