The hoisting of the national flag in Sinjar, home to Iraq's Yazidi religious minority, is the result of a deal months in the making for the federal government to restore order from a tangled web of paramilitaries, who sowed chaos in the district during the bedlam following liberation from IS three years ago.