Device-to-device (D2D) communications offers high spectral efficiency, low energy consumption and transmission latency. However, one of the main limitations of D2D communications is co-channel interference from underlaying wireless system. Reconfigurable intelligent surfaces (RIS) is a promising technology because it can manipulate the electromagnetic waves in their environment to overcome interference and enhance wireless communications. This paper considers RIS enhanced D2D communications underlaying unmanned aerial vehicle (UAV) networks with non-orthogonal multiple access (NOMA). The objective is to maximize the sum rate of NOMA D2D communications by simultaneously optimizing the power budget of D2D transmitter, NOMA power allocation coefficients of D2D receivers and passive beamforming of RIS while guaranteeing the quality of services of UAV user. Due to non-convexity, the optimization problem is intractable and challenging to handle. Therefore, it is solved in two parts using alternating optimization. Simulation results unviel the performance of the proposed RIS enhanced D2D communications scheme. Results demonstrate that the proposed scheme achieves 15\% and 27\% higher sum rates compared to the fixed power D2D and orthogonal D2D schemes.