This is the last of a series of alternative mobile OS installs and the easiest install by a country mile !
Everything is quite well documented here: https://wiki.ubuntu.com/Touch/Install.
sudo add-apt-repository ppa:phablet-team/tools
sudo apt-get update
sudo apt-get install phablet-tools android-tools-adb android-tools-fastboot
phablet-flash ubuntu-system --channel devel --bootstrap
That is it really ! This is how a OS change on a mobile should work !
Ubuntu touch can not yet handle the radio firmware past Android 4.3 devices. So if your N4 was upgraded to Android 4.4 (KitKat) you need to flash the radio to the Android 4.3 (up to Version 2.0.1700.84) else WIFI will not work.
Download 4.3 Stock Image from: https://developers.google.com/android/nexus/images#occamjwr66y
fastboot flash radio fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.84.img
(Optional – this can be done via phone UI as well). Connect the phone via USB
nmcli -pretty dev wifi connect NETWORK-NAME password PASSWORD