The file 'M6-1.0mm Nuts And Bolts (15-30mm) 3D Printer Model' is (stl) file type, size is 1.2MB.
Please visit full collections of bolts in printables here https://www.printables.com/model/211375-m6-10mm-nuts-and-bolts-15-30mm as well.
I like Sanding Wedge by Trierscheid https://www.thingiverse.com/thing:4757166 but I do not have M6 bolts or nuts. I decided to create myself for this purpose. I then expanded this project to support multiple length as needed even for other purpose.
When printing, depending on the strength you need, you may want to have higher perimeter value, or use modifier in slicer to strengthen closer to head part by even higher perimeter and/or infill.
Each bolt has thread surface offset by -0.1 mm so it functions with the printed nut.
Example gcode is available. I personally put modifiers in the head to strengthen by adding more perimeters (12) but it is your choice. You may print with 2-3 perimeters, they could work fine for your purpose.
M6_Bolt_15mm.stl | 2.1MB | |
M6_Nut.stl | 525.4KB |