The earliest evidence for the date is a Roman document of 354, and it is worth reading precisely because it is regularly misdescribed.
The Chronography of 354 is a compiled almanac. One of its parts, a civil calendar, records for the eighth day before the kalends of January the entry N INVICTI CM XXX, birthday of the Unconquered, thirty races ordered, which is the oldest literary reference to a festival of Sol Invictus on that date. A different part, the Depositio Martyrum, a list of commemorations, records for the same day: born Christ in Bethlehem of Judaea. That is the earliest reference to the nativity kept as an annual feast.
So a single document attests both observances in Rome by the mid fourth century. What it does not do is establish which came first or that one produced the other, and this is where popular accounts overreach.
The rival explanation, argued at length by Thomas Talley and others, is the calculation hypothesis: an early Christian tradition held that a prophet died on the same date he was conceived, put the crucifixion at 25 March, therefore put the conception at 25 March, and arrived at 25 December by counting nine months. That reckoning is attested in the third century, in Hippolytus and in an African treatise on the computation of Easter, before any evidence of a December feast. On this account the date is derived internally and its coincidence with the solar festival is a consequence of both being anchored near the solstice.
Neither hypothesis has won. Both are held by serious historians of liturgy.