After finely grating the bar of soap, add it to a bowl along with the borax,washing soda, and baking soda.
Whisk together very well to make sure it is all evenly distributed.
Put in an air-tight container to prevent clumping.
Use 2-4 tablespoons per load for regular machine, and 1-2 tablespoons for an HE machine.
Notes
If washing with cold water, mix detergent with warm/hot water first to help it dissolve and not stick to clothes. I just add the detergent to the washer and run it on hot water until it starts to fill up, and then switch it to cold water and add the clothes.