These are the way I mounted my X, Y & Z Limit switches on my Sphinx CNC to give them a cover & also give the most cutting space, especially in the Z-axis.
I mount the limit switches in the covers using M2.5x12mm screws & locknuts.
I use 3 - M5x10mm to mount the Z-axis cover & carriage arms. The Z-axis M5 screws can not be longer than 10mm. You can mount the X & Y axis covers with M5x10 or M5x12 screws.
There is an openscad source file for the XY axis combined in one file. The Z-axis has 2 openscad files. One for the Z-axis Limit switch cover & one for the Z-axis arm which hits the limit switch. You can micro adjust the height of the Z limit switch using an M3 screw with a locknut on the end or use the plastic nut in the file.
To use all these mount covers, print Sphinx_X_LimitSwitch_Rev70.stl, Sphinx_Y_LimitSwitch_Rev70.stl, Sphinx_Z_Top_LimitSwitch_Rev56.stl, Z_Carriage_Arm_Rev17.stl and Z_Carriage_Arm_ZNeg8_Rev17.stl. I say print both of the carriage arms to see which works best for you. The ZNeg8 version with M3 screw gives more adjustment. If you are using openbuilds micro limit switches or similar, you will need to drill out those 2 holes with a 7/64" drill bit or use M2 screws instead of M2.5.
The 2 parts for the Z limit switch should also fit the openbuilds mini-mill and probably any machine that uses that combination reduction plate & c-beam double wide gantry plate.
My build log for this machine can be found: