Theory of Equilibrium Flux Lattices in Unconventional Superconductors