Plaid Cymru's Rhun ap Iorwerth has been confirmed as Wales' first minister, calling it "the greatest privilege of my life".