replace fireplace switch with nest thermostat
You need both a transformer and a relay to do this

The Nest cannot switch a millivolt system on its own, even when supplied with 24VAC, as it has solid-state output switches instead of mechanical relays.  Hence, you'll need both a 24VAC transformer and a 24VAC fan relay in order to control your fireplace from your Nest.  The transformer secondary goes to Rh and C, while the relay coil is connected to W and C, and the relay contacts connect to the existing switch wires.