A synthetic metabolic network for physicochemical homeostasis