Model originally uploaded to Thingiverse at https://www.thingiverse.com/thing:2172386.
This small switch box is designed to house a 20mm rocker switch, and mounts to 2020 extrusion. The box wraps around the extrusion, covering two sides. It's secured with a single M4 screw and t-nut, and includes an access hole so an Allen key can be used to tighten the screw. There are a few additional holes included to allow wiring to be routed within the channel on the extrusion. The box is in two parts, and the cover can be secured with M3 screws. The holes in the body are 2.5mm diameter, and I tapped them to M3, although you could probably get away without tapping them and just drive a screw in.
There are plenty of 20mm diameter rocker switches available, but these are the ones I used: https://www.amazon.co.uk/gp/product/B01K7MNPB6 You will also need an M4x8 screw, M4 t-nut and two M3x10 screws for attaching the cover.
To assemble: start by feeding the wires into the box and out through the large hole in the front. Position an M4 t-nut in the extrusion channel and offer the box up to the extrusion. Insert an M4x8 screw into the screw hole, align it with the t-nut, and tighten it with an Allen key inserted through the access hole. Wire up the switch before pushing the switch into the housing.
If you wanted multiple switches, it would be possible to stack several of these together on the extrusion.