Building the Android OS from source has caused me a bit of pain, so it was therefore a pleasant surprise to see just how easy the CyanogenMod team has made their install and update process. For the Nexus S, it boiled down to: Follow the instructions, any everything just works. Therefore these are just some background notes; for full details, see the CyanogenMod install page.

What is a bit confusing in the Android world, are all the obscure and redundant code names from everything from hardware, models, OS, firmware, versions, regions. The Google Nexus binary pages gives some hints, as does the Android build instructions. For the Nexus S, it is crucial to know that the alternative codename is "crespo". Furthermore, it is useful know that it has a "HDPI" display, and comes in three variations: "GT-I9020 (Super AMOLED) and GT-I9023 (Super Clear LCD), each aimed at different markets. The SPH-D720 is the newer 4G version of the phone available in the US." (Wikipedia). Also, the radio binaries have different codes, e.g. "XXKB3". This then forms the "baseband version" code on the form "I9023xxkd1", which can be found under Settings -> About phone.

CyanogenMod is just a layer on top of the Android OS, thus it's tracking the Android versions. Here we are talking about "Gingerbread" for the 2.3.x series, and "Ice Cream Sandwich" (aka. ICS) for the 4.x versions. (Who comes up with all these useless names??) Although Google pushed Android 4 to certain Nexus S devices in December 2011, and CM 9 (which based on Android 4) have nightly builds for the "crespo", their stable CM 7 is still at Android 2.3.7. In addition to the basic OS, you might also want the Google Apps, although, some of them might have to be downloaded from the Market (now renamed to "Play") anyway.

So, with that out of the way, and assuming the basic tools adb and fastboot in place (possibly from a previous build session), the upgrade can be summarized as this (with specific versions and URLs bound to change):

Download:
wget http://download.clockworkmod.com/recoveries/recovery-clockwork-5.0.2.0-crespo.img
wget http://download.cyanogenmod.com/get/update-cm-7.1.0.1-NS-signed.zip
wget http://cmw.22aaf3.com/gapps/gapps-gb-20110828-signed.zip

Flash the recovery image:
adb reboot-bootloader
sudo fastboot flash recovery recovery-clockwork-5.0.2.0-crespo.img
sudo fastboot reboot

Copy the CM files to the "sdcard" of the phone:
adb push update-cm-7.1.0.1-NS-signed.zip /sdcard/update.zip
adb push gapps-gb-20110828-signed.zip /sdcard/gapps.zip
adb reboot-bootloader

Follow the install instructions from CM for the rest. I was surprissed to learn that the data on the SD card was not wiped as well (I thought "Wipe data/factory reset" would take care of this). However, maybe I missed a step.