Gauging of flat groups in four dimensional supergravity