Text this: Unified theory for light-induced halide segregation in mixed halide perovskites