Running Arduino IDE on non-Arduino board (own PCB with ATmega328p)

I don't know enough about the 1MΩ over the crystal. I think the official Uno board has a resonator ?

The RX of the Uno is connected to the usb-serial chip. If it is open (floating) and nothing is connected to it, then it can receive noise. I looked at the schematic of the Arduino Mini, and the RX is open. It is a problem that I ran into with my own barebone board.

This topic about the 22pF capacitors might be interesting: https://forum.arduino.cc/t/custom-atmega2560-board-clock-issue/704178.