All laundry detergents without softener, are safe for cloth nappies. Fabric softener covers the fibers of the fabric which inhibits absorption.
Always follow the recommended dosage for a soiled load per the detergent manufacturer's instructions.
For hard water it is best to use powder detergents as it contains water softeners. No soaps (eg sunlight gel) to be used with hard water.
Gentle or baby detergents most of the time do not have adequate cleaning power to get heavily soiled laundry like cloth nappies clean.
Below is a summary of the manufacturer's instructions for the most common detergents: