systemd tends not to set environment variables. However some firstboot scripts generally expect $HOME to be correct.
Ubuntu 22.04 makes some changes, notably removing the custom-installation hooks. Change to injecting our modifications more directly to where the custom-installation hooks used to be.