xcode minimum system requirements

I wanna know what is the minimum requirement for running xcode because in my macbook xcode taking a lot of swap memory and lagging too ,So I am thinking of buy new mac mini , can u guys tell me should i get m2 or m2 pro , what ram and storage should I opt , Or is there is a way I can develop ios app on windows or linux.

xcode minimum system requirements
 
 
Q