Derivation of disjoining pressure on a flat surface
Consider a box where vapor and liquid equilibrium exists. The liquid is on the top of the solid surface. The system is at constant (T, P).
The chemical potential of vapor phase and liquid phases are $\mu_v$ and $\mu_l$. $dN$ molecules from the vapor phase transfers to liquid phase and increase the thickness by $\dt$. The gibbs free energy change for this process is
\begin{equation} dG = -SdT + VdP + \mu_v dN_v + \mu_l dN_l + \gamma dA \end{equation}