Depends on the Mac mini model I think; used Mac mini m4 16gb 256gb are priced quite low compared to the performance - I believe close to best bang for the buck - and are I believe near best energy efficiency. I love them for heavy cpu tasks without loud fans and heat in my office (pcs did this in my previous homelab setup for a bit less performance).
The higher specced max minis (more memory or pro)
Are worse bang for buck.
I'd love to have possibility to compare M4 with Ryzen 5700u as a server. I've read a comparison of M1 against 5700u and it was quite good price for value tbh.
EDIT
According to some site M4 is 2 times faster and 3 times more expensive, while you can later add memory to Ryzen but not to M4
The higher specced max minis (more memory or pro) Are worse bang for buck.