I suspect you had moisture buildup inside the cab from some source or another. Breathing, wet clothes/boots, leaks or something else. As the air cools (and the roof even faster) the water condenses out first on the coldest surface in the vicinity which is usually the roof (more exposed to the sky). parking under shelter will make all of the metal a more uniform temperature but the best solution is to reduce the moisture inside the cab. Find/fix any leaks, ventilate for the last part of the drive, if you have a heater setting it to cold air circulation with the windows part open will lower the moisture content available to condense and freeze. In short, all the same things you do to prevent snow melt from condensing and freezing on the inside of your windows in the daily driver.