use this part instead of a standard DIN rail mount, and one of these (depending on the height of the installed heat sink)
https://www.printables.com/model/592877-raspberry-pi-with-heat-sink-30mm-fan-shroud
https://www.printables.com/model/557377-raspberry-pi-30mm-fan-mount
along with 30mm fan
The author remixed this model.
any standard DIN rail mount takes up all 4 PCB holes, making it difficult to install the fan shroud. This model allows you to use these 4 holes for both.
M2.5 x 18 – 4
Klipper:
[temperature_fan RPI_fan]
pin: ^PA8
kick_start_time: 0.8
off_below: 0.8
max_power: 1.0
sensor_type: temperature_host
control: pid
min_temp: 0
max_temp: 100
pid_kp: 1.0
pid_ki: 0.5
pid_kd: 2.0
min_speed: 0.0
max_speed: 0.8
target_temp: 40