More interestingly, when, where, and how did nationalist thought begin to rise in the Austro-Hungarian empire? Was its dissolution organic or were midwives involved? The war famously began because of an assassination by a Serbian nationalist. (Wikipedia has nationalism modern root in the French Revolution but as a non European I find that unconvincing.)
I don’t find the idea that the serf/laborer class harbored “nationalist” thoughts to be very convincing, tbh. Conceptually, the critical attribute is group identity. For that class, religion definitively provided that (supporting proof being the European religious wars) but I wonder if non religious identity extended beyond the village or maybe guilds for the skilled laborers. In each of these cases, there is a structural basis for affinity — one being faith and the other profession.
In general, I wonder if there is any historical basis to the idea that nationalism was an artificial intellectual concept that later infected the general population. Also important to note we should distinguish patriotism (broadly read as support for the sovereign system) from nationalism. The latter more typically is suppressed by patriotic elements in any given society as national boundaries and political boundaries rarely are coincidental.
But I return back to my earlier comment about songs and proles. An expert in 17th century folk songs of European people can shed light on what preoccupied the minds of the lower classes. I sincerely doubt it was ethnic fervor.
This is just an armchair theory of mine: the seeds were planted by Luther who insisted that every nation should have a Bible in their native language. This naturally forms a strong identity. Those sprouts were then nurtured by westphalian nation-state system. Which then got infused by ideas of French revolution via a short period of Napoleonic empire throughout Europe. And in Balkans too. Any references to older events of identity in history should be regarded upon as suspect of revisionism for current political purpose.