All this is true, but it's also true that the nukes weren't the only factor involved. A good case can be made that it was actually the Soviet invasion of Manchuria, which started at midnight local time on the same morning that Nagasaki was bombed, that gave the peace faction in the Japanese government enough leverage to get the Emperor to intercede. The Japanese still weren't exactly sure what the nuclear bombs were, and they had already been firebombed for months so having two more cities incinerated was not the huge change that later US propaganda made it out to be. But the Japanese had been trying for many months to get Stalin and the USSR to broker a peace agreement, and Stalin and Molotov had been stringing them along without any real intention of helping, to ensure that Stalin would have time to enter the war against Japan. The Soviet invasion of Manchuria shocked the Japanese government into realizing their true position and made surrender an urgent priority since Japan greatly preferred being occupied by the US to being occupied by the USSR. The nuclear bombs were a convenient way for the Emperor to save face and not have to admit that it was really the strong desire of the Japanese to surrender to the US and not to the USSR that drove the decision.
See the excellent book Racing the Enemy by Hasegawa for a detailed and thorough exposition:
https://www.amazon.com/Racing-Enemy-Stalin-Truman-Surrender/...