I know that in general, given a (stacked) regression of the form $ y = X \beta + \epsilon$, where $\mathbb{V}(\epsilon_i) = \sigma^2 \forall i$, then letting $\hat{\beta}$ denote the OLS estimate of $\beta$, \begin{equation} \mathbb{V}(\hat{\beta}) = \sigma^2 (X'X)^{-1} \end{equation}
This I understand. In my econometrics class, we are studying randomized trials with binary treatment, so $X \in \{0,1\}^n$, where $n$ is the number of observations. I am told that in this simple setup,
\begin{equation} \mathbb{V}(\hat{\beta}) = \frac{\sigma^2}{p(1-n)p} \end{equation}
where $p$ is the proportion of observations $i$ such that $X_i = 1$.
I have no idea how to derive the second equation from the first. Any hints?