This is my PIR HC-SR501 housing with two types of wall mount. One simple with "only" 360° rotation (up/down). The other includes also almost 180° (left/right) adjustment option.
The box itself consists of two parts (front/back) which fit precisely each other and both are hold together by attaching the wall mount holder over the side "buttons", so no screws or glue needed, unless you want to have it waterproof. Then I would suggest using a silicone.
Additionally the front part has a small tube hole around the pir lens where you may fit a sun shield, if used outside. I made two types but it is easy for you to make any other type as I added a "dummy" half globe where you can make your own hole or simply create a tube with 1mm thick wall and outer diameter 26mm. The hole in the front part is 1mm deep.
I also added a dummy pir object which you can use as a "hole" for your own box or any adjustments of my design.
Dimensions are according to my HC-SR501 and you may need to bend a little contacts if you are using a connector.
There is no hole made for cables as you can easily create it anywhere, depending on your needs.
Printed with PETG. Right after the print the rotating parts rotate slightly hard but twist it few times and the plastic will smooth the edges and will rotate well enough but keep the position set.