We wish to compute the determinant of the $n\times n$ matrix
$$
M=\begin{bmatrix}
1-\lambda&1&1&\cdots&1\\
1&1-\lambda&1&\cdots&1\\
1&1&1-\lambda&\cdots&1\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
1&1&1&\cdots&1-\lambda
\end{bmatrix}\tag1
$$
Here are two approaches, the second of which uses a generalization of the lemma cited in Rodrigo de Azevedo's answer.
Finding a Similar Matrix
Note that the $n-1$ dimensional subspace orthogonal to $\begin{bmatrix}1&1&1&\cdots&1\end{bmatrix}^\text{T}$ is multiplied by $-\lambda$. (If the subspace is orthogonal to a given vector, we can subtract that vector from each row of the matrix when operating on that subspace.)
$\begin{bmatrix}1&1&1&\cdots&1\end{bmatrix}^\text{T}$ is multiplied by $n-\lambda$. (Just compute it.)
Thus, $M$ is similar to
$$
\begin{bmatrix}
-\lambda&0&0&\cdots&0\\
0&-\lambda&0&\cdots&0\\
0&0&-\lambda&\cdots&0\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
0&0&0&\cdots&n-\lambda\\
\end{bmatrix}\tag2
$$
Therefore,
$$
\det(M)=(-\lambda)^{n-1}(n-\lambda)\tag3
$$
$\boldsymbol{\det(\lambda I_n-AB)=\lambda^{n-m}\det(\lambda I_m-BA)}$
As shown in this answer,
$$
\det(\lambda I_n-AB)=\lambda^{n-m}\det(\lambda I_m-BA)\tag4
$$
Let $A=\begin{bmatrix}1&1&1&\cdots&1\end{bmatrix}^\text{T}$ and $B=A^\text{T}$, then $M=AB-\lambda I_n$.
Furthermore, $m=1$ and $BA=\begin{bmatrix}n\end{bmatrix}$.
$(4)$ then says that
$$
\begin{align}
\det(-M)
&=\det(\lambda I_n-AB)\tag{5a}\\[2pt]
&=\lambda^{n-1}\det(\lambda I_1-BA)\tag{5b}\\[2pt]
&=\lambda^{n-1}\det(\lambda I_1-\begin{bmatrix}n\end{bmatrix})\tag{5c}\\
&=\lambda^{n-1}(\lambda-n)\tag{5d}
\end{align}
$$
which, since $\det(-M)=(-1)^n\det(M)$, becomes
$$
\det(M)=(-\lambda)^{n-1}(n-\lambda)\tag6
$$