Print the two pieces.
Add nuts, washers or any other counterweight to the big hole in the moving part (I used 3 M8 fender washers).
Add 3x2mm (dxh) magnets to the small holes.
Add a M3 screw to the remaining hole, to adjust the magnet distance and thereby the force needed to release.
Use a piece of filament or a toothpick as the axle.
Cut an appropriate hole in a piece of 18mm thick wood, OSB or whatever material, and screw the frame in from below.
Add a tunnel over the door so the mouse can only get at the bait from one side and must cross the door.
Drill a number of small holes near the bottom of the bucket so the mice don't suffocate. Don't make those so big that the mice can chew their way out, I used 2mm.
Put bedding in the bucket, add some food and water if you leave it unattended for multiple days, and add bait leading up to the trap and at the far end of the door.