Optical quantum memories are key elements in modern quantum technologies to reliably store and retrieve quantum information. At present, they are conceptually limited to the optical wavelength regime. Recent advancements in x-ray quantum optics render an extension of optical quantum memory protocols to ultrashort wavelengths possible, thereby establishing quantum photonics at x-ray energies. Here, we introduce an x-ray quantum memory protocol that utilizes mechanically driven nuclear resonant 57Fe absorbers to form a comb structure in the nuclear absorption spectrum by using the Doppler effect. This room-temperature nuclear frequency comb enables us to control the waveform of x-ray photon wave packets to a high level of accuracy and fidelity using solely mechanical motions. This tunable, robust, and highly flexible system offers a versatile platform for a compact solid-state quantum memory at room temperature for hard x-rays.