The transport coefficients for dilute granular gases of inelastic and rough hard disks or spheres with constant coefficients of normal ($alpha$) and tangential ($beta$) restitution are obtained in a unified framework as functions of the number of translational ($d_t$) and rotational ($d_r$) degrees of freedom. The derivation is carried out by means of the Chapman--Enskog method with a Sonine-like approximation in which, in contrast to previous approaches, the reference distribution function for angular velocities does not need to be specified. The well-known case of purely smooth $d$-dimensional particles is recovered by setting $d_t=d$ and formally taking the limit $d_rto 0$. In addition, previous results [G. M. Kremer, A. Santos, and V. Garzo, Phys. Rev. E 90, 022205 (2014)] for hard spheres are reobtained by taking $d_t=d_r=3$, while novel results for hard-disk gases are derived with the choice $d_t=2$, $d_r=1$. The singular quasismooth limit ($betato -1$) and the conservative Pidducks gas ($alpha=beta=1$) are also obtained and discussed.