Linear and nonlinear optical excitations in spatially-inhomogeneous semiconductor systems