Reconfigurable intelligent surfaces (RISs) are considered a key paradigm to improve the coverage of beyond-fifth-generation (B5G) networks as signal reflectors. Moreover, device-to-device (D2D) communications and non-orthogonal multiple-access (NOMA) schemes will enable networks with a large number of devices for the Internet of Things. This paper analyzes the performance of the downlink of B5G network, where both a NOMA-empowered BS and a RIS support cellular communications co-existing with inband D2D transmissions. We derive approximate expressions of the outage probability, the cumulative distribution function (CDF), and the probability density function (PDF) of the signal-to-noise-plus-interference ratio (SINR) of the NOMA-connected users and the D2D receivers. We further derive similar expressions under orthogonal multiple access (OMA) transmission for comparison purpose. Then, we numerically compute the ergodic rate of each user for a given power allocation. The derived expressions are validated by extensive simulations.