A simple formalism for the calculation of the equilibrium activity coefficients of electrons and holes in a nondegenerate semiconductor with nonuniform composition is presented. These activity coefficients are functions of bandgap, electron affinity, and the density of states which vary with position. The calculation of carrier activity coefficients requires the selection of chemical potential and electrostatic potential references. The choice of these reference states is addressed. The relations between purely thermodynamic quantities and parameters of the band theory are also presented. It is shown that the intrinsic level is a purely thermodynamic property of the intrinsic bulk semiconductor. The approach presented here allows convenient treatment of nonuniform semiconductors in a manner that is both thermodynamically consistent and consistent with the Poisson-Boltzmann equation for the electrostatic potential.