Covalent magnetism and invar-like behaviour within ternary nitrides