Numerical linked cluster expansions for inhomogeneous systems