The representation theory of reductive groups over finite fields is realized in the cohomology of Deligne--Lusztig varieties, which are certain subvarieties of flag varieties. These have finite-ring analogues that are attached to the parahoric subgroups corresponding to points on the Bruhat--Tits building of a p-adic group. I will discuss these stories and their role in recent progress towards understanding affine Deligne--Lusztig varieties, subvarieties of affine flag varieties that are closely related to the mod-p reduction of Shimura varieties. This is joint work with Alexander Ivanov.