My understanding is that the Habsburgs dominated the Holy Roman Empire for a long time, and the HRE eventually formed Germany as a nation-state. Why wasn't Austria part of the German unification?
The Holy Roman Empire did not 'form' Germany, in fact the HRE had been dissolved 70 years before Germany was even formed. The HRE from the 15th century onwards was consistently dominated by the von Habsburgs and it was even dissolved by a von Habsburg, the last Emperor Francis II von Habsburg. The reason for this would be more appropriate in a different thread, but basically Napoleon is the reason.
The country that led the German unification was the Kingdom of Prussia, Austria's rival in the region. These two powers were both wrestling for control and influence in the new German Confederation, which was set up by the Congress of Vienna to replace the HRE in the aftermath of the Napoleonic wars. There was a big 19th century debate that came to a climax in the revolutions of 1848 over how a German state should be created. Austria supported the idea of Großdeutsche Lösung (Greater German solution) which aimed to unify all German speakers under one state. Prussia on the other hand favoured Kleindeutsche Lösung (Lesser German solution) which aimed to unify only the north German states (which obviously excludes Austria).
Religion played a role in this 'German Question', the Großdeutsche Lösung suggestion would have resulted in Austrian and catholic dominance of the new unified German state as Austria was the largest and most powerful German state at the time. Because of this, many Catholic and Austrian-friendly nations in the Confederation favoured the Großdeutsche Lösung idea.
In contrast if the unification was led by the Kingdom of Prussia, the new state would be dominated by Protestants, which was the favoured option of Prussia and the northern German states.
The Austrian Empire included many different ethnic groups such as the Romanians, Czechs, Croats etc, and they were hesitant to enter a unified Germany if it meant giving up these regions.
The German Confederation was weak and ineffective and eventually came to end in 1866 with war between Prussia (+ her allies) and the German Confederation led by Austria (+ her allies). The brief war ended in victory for the Prussians and resulted in the abolishment of Austrian hegemony as well as the confederation. Prussia under the leadership of Wilhelm I and Otto von Bismarck then led the formation of a new German entity, the North German Confederation. This Prussian led confederation was the basis of the German Empire and effectively sidelined Austria, who was also suffering from ethnic rebellions throughout her empire.
Bismarck then used the Franco-Prussian War to convince the remaining German states such as Bavaria (excluding Austria) to form an alliance and stand against the (Second) French Empire, led by Napoleon's nephew... Napoleon (the III). The war was quick and ended in humiliation for the French, and Bismarck used the opportunity to declare the German Empire with Wilhelm I as Emperor. This new German Empire and was very much a Prussian-run state and as a result Kleindeutsche Lösung won out.
TLDR Austrian-Prussian rivalry, Catholics vs Protestants, Austria including many non-German ethnic groups, the growing might of the Prussian state and the brilliance of Bismarck.