The mythology of True Detective is heavily indebted to the collaborative works of early horror -fiction/pulp horror writers, such as Lovecraft, Ligotti and Chambers.
David Lynch is an avowed fan of the lore of this genre, and his work is often compared to the style of H.P. Lovecraft himself.
That's not to say the two are being deployed as iterations within the same universe, but as to say they are both overt in the circulation of their references.
The concept of 'Carcosa' is directly lifted from Robert Chambers short stories book, The King in Yellow. Within it is the poem 'Cassilda's Song', seemingly riffed by Ledoux in true detective:
Along the shore the cloud waves break, The twin suns sink behind the
lake, The shadows lengthen In Carcosa.
Strange is the night where black stars rise, And strange moons circle
through the skies, But stranger still is Lost Carcosa.
Songs that the Hyades shall sing, Where flap the tatters of the King,
Must die unheard in Dim Carcosa.
Song of my soul, my voice is dead, Die thou, unsung, as tears unshed
Shall dry and die in Lost Carcosa.
It is yet to be confirmed whether True Detective is an interpretation of this poem/works, or whether the characters contained within are said to be inspired by the works themselves, meaning The King in Yellow is a book that exists in the True Detective universe.
The latter is unlikely, however, as Cohle's research would undoubtedly yield the same reference shown here and they would be following up on the connection.