We study Johnson-Nyquist noise in macroscopically inhomogeneous disordered metals and give a microscopic derivation of the correlation function of the scalar electric potentials in real space. Starting from the interacting Hamiltonian for electrons in a metal and the random phase approximation, we find a relation between the correlation function of the electric potentials and the density fluctuations which is valid for arbitrary geometry and dimensionality. We show that the potential fluctuations are proportional to the solution of the diffusion equation, taken at zero frequency. As an example, we consider networks of quasi-1D disordered wires and give an explicit expression for the correlation function in a ring attached via arms to absorbing leads. We use this result in order to develop a theory of dephasing by electronic noise in multiply-connected systems.