Solving a system of linear congruences 
Find all positive integer solutions to \begin{align*}x &\equiv -1 \pmod{n} \\ x&\equiv 1 \pmod{n-1}. \end{align*}

I rewrote the system as $x = nk_1-1$ and $x = (n-1)k_2+1$. Thus, we have $nk_1-1 = (n-1)k_2+1$ and so $n(k_1-k_2) = 2-k_2 \implies n = \frac{2-k_2}{k_1-k_2}$. How do I solve it from here?

First note that $x_0=2n-1$ is a solution. 
Now, if $x$ is a solution, then $x\equiv x_0\pmod n$ and $x\equiv x_0\pmod {n-1}$. Thus, $n|x-x_0$ and $(n-1)|x-x_0$. Also, since $\gcd(n,n-1)=1$, we have $n(n-1)|x-x_0$. 
Moreover, for all non-negative integer $k$, we can check that $x=2n-1+kn(n-1)$ is a solution. 
Thus, all solutions are $x=2n-1+kn(n-1)$, where $k\in \mathbb{Z}_{\geqslant 0}$.
