+1 on Mac mini as well. I just checked OfferUp in my area and M1-M5 are insanely expensive ($500+, M1 coming out about 6 years ago) but really good machines especially for their size and decent on power consumption too.
But downside of a M series is either you run macOS or Asahi Linux and nothing else yet.
So go for the Intel Mac Minis which are much cheaper and can run nearly any Linux distro with little to no issues as you would on a Windows PC. I’m seeing $50 range in my area as well. Older are good because RAM can be upgraded on some of them, but not all. Would be wise to do research on whichever seems right.