The Moon is capable of having an Earth-like atmosphere. Although the escape velocity of the Moon is much smaller than Earth's, it is still around Mach 6.(*)
If the Moon had an atmosphere, it would lose it in some tens of millions of years(*). This is why any atmosphere it once had is long gone, but this would be enough for us and our shorter time scale, which is only some thousands of years in the most optimistic sense.
Nitrogen is rare on the Moon, but it is not really needed. We don't use it for anything. What matters is the partial pressure of the $O_2$ in the atmosphere. In a 100% $O_2$ atmosphere with around 0.2 bar pressure (20% of the air is $O_2$) we could breathe without any major problem.
But the Moon has a much weaker gravity, it is only around 1/6 or the Earth. Therefore, approximately 6 times more per-area mass of the atmosphere would be required to get the same pressure. This means that around of 1.2 kg of $O_2$ would be needed over every $cm^2$ to get the required $O_2$ pressure (on the Earth, it is around 1 kg).
The Moon's radius is also around 1/6 of Earth's, so its surface area is 1/36 of Earth's. The surface area of the Earth is $5.1*10^8 km^2$, so the Moon's surface area is $14*10^6 km^2$, which is $1.4*10^7*10^{10}=1.4*10^{17} cm^2$. So around $1.6*10^{17}$ kg of $O_2$ would be required.
The lunar soil is mainly composed of regolith, which is essentially a mix of different metal oxides. It melts around at $1200K$, which is essentially lava. On the Earth, a similar substance is produced from volcanoes.
Well, most of its components have a much higher melting point (for example, $Al_2 O_3$'s is over $2000K$), but not all of them. The molten salt mixes have a normally much lower melting point, this is why this around $1200K$ would be enough.
These molten salt mixes are poor electrical conductors, but are conductive conductive to be electrolysable, and a temperature of around $1000K$ is not unfeasible. Although most of the electric energy would simply heat the lava, a significant part would produce $O_2$. The electric effectivity of different electrolysis processes are in the order of 10-60%, so we can now calculate with their geometric mean, which is around 25%.
The burning heat of the Al is around 22 $\frac{MJ}{kg}$, its molar mass is 27. Thus, burning of 1kg of Al gives 22 MJ of energy, it is 37 mol, which consumes 37*1.5 (Al2O3!), so 55 mol of $O$. This 55 mol of oxygen is 888 g.
Thus, to produce an Earth-like O2 atmosphere on the Moon, we would need to produce around $1.8*10^{17} kg$ of Al. This would require around $4*10^{18} MJ$ of energy, or $4*10^{24} J$. Considering an effectivity of 20%, it is around $2*10^{25} J$.
The yearly Al production on the Earth is around 40 million tons. To produce this mass of Al we would need 4.5 million years - on the Earth.
According to this article, on Earth there was around 184 TWh of solar energy produced in 2015. This is $6.62*10^{17} J$. Thus, to produce the required $2*10^{25} J$ of energy, we would need around 30 million years.
But on the other hand, although this project doesn't seem feasible in our lifetime, perhaps in a better world it would be possible to make automated factories staffed by robots, to build the required number of PV cells and electrolysis chemical factories on the Moon. Actually, if we had enough robots we could do anything, and robots could be also produced by robots.
(*) I am very happy to google some references if anyone asks.