Autogenerate unit files

It is error-prone and tedious to create new unit files. This CL adds code
to auto-generate the unit files, which will reduce effort and error