Dark energy from topology