We compute the full Lyapunov spectra for a hard-disk fluid under temperature gradient and under shear. The Lyapunov exponents are calculated using a recently developed formalism for systems with elastic hard collisions. The system is thermalized by deterministic and time-reversible scattering at the boundary, whereas the bulk dynamics remains Hamiltonian. This thermostating mechanism allows for energy fluctuations around a mean value which is reflected by only two vanishing Lyapunov exponents in equilibrium and nonequilibrium. In nonequilibrium steady states the phase-space volume is contracted on average, leading to a negative sum of the Lyapunov exponents. Since the system is driven inhomogeneously we do not expect the conjugate pairing rule to hold, which is indeed shown to be the case. Finally, the Kaplan–Yorke dimension and the Kolmogorov–Sinai entropy are calculated from the Lyapunov spectra.