A preventative measure is to use an inorganic growing medium, especially with a top dressing of (3mm) grit.
Also, granules containing diazinon or bromophos (if available!) can be incorporated into the seed compost.
Soak compost with insecticide. In some countries dimethoate, malathion and diazinon are still available. Otherwise, permethrin or pyrethrum sprays.
Very dilute tar-based disinfectant, such as Jeyes Fluid, will kill the larvae.
A green method of control is to place a few insectivorous plants, such as Pinguicula (See photo below) or Drosera (Sundew) around the propagator - these will catch most of the adult sciara fly.