  We present a density functional theory analysis of the negatively charged
nitrogen-vacancy (NV$^-$) defect complex in diamond located in the vicinity of
(111)- or (100)-oriented surfaces with mixed (N,H)-terminations. We assess the
stability and electronic properties of the NV$^-$ center and study their
dependence on the H:N ratio of the surface termination. The formation energy,
the electronic density of states, the hyperfine structure and zero-field
splitting parameters of an NV$^-$ center are analyzed as function of its
distance and orientation to the surface. We find stable NV$^-$ centers with
bulk-like properties at distances of at least $\sim8$ Angstroem from the
surface provided that the surface termination consists of at least 25\%
substitutional nitrogen atoms. Our results indicate that axial NV centers near
a flat 100\% N-terminated (111) surface are the optimal choice for NV-based
quantum sensing applications as they are the least influenced by the proximity
of the surface.
