Theory and simulation of domain walls in halide perovskites