We present a novel approach for constructing nonequilibrium steady states. It is based on a deterministic and time-reversible mechanism for dissipating energy from a subsystem into a thermal reservoir. The key idea is to thermalize a moving particle by appropriately modeling its microscopic collision rules with a boundary mimicking a thermal reservoir with arbitrarily many degrees of freedom. We demonstrate our method for the periodic Lorentz gas with an external electric field. By applying our thermostat we do not find an ergodic breakdown with increasing field strength.