  Consider a surface $\Omega$ with a boundary obtained by gluing together a
finite number of equilateral triangles, or squares, along their boundaries,
equipped with a flat unitary vector bundle. Let $\Omega^{\delta}$ be the
discretization of this surface by a bi-periodic lattice with enough symmetries,
scaled to have mesh size $\delta$. We show that the logarithm of the product of
non-zero eigenvalues of the discrete Laplacian acting on the sections of the
bundle is asymptotic to \[
A|\Omega^{\delta}|+B|\partial\Omega^{\delta}|+C\log\delta+D+o(1). \] Here $A$
and $B$ are lattice-dependent constants; $C$ is an explicit constant depending
on the bundle, the angles at conical singularities and at corners of the
boundary, and $D$ is a sum of lattice-dependent contributions from
singularities and a universal term that can be interpreted as a
zeta-regularization of the continuum Laplacian on $\Omega$. We allow for
Dirichlet or Neumann boundary conditions, or mixtures thereof. Our proof is
based on an integral formula for the determinant in terms of theta function,
and the functional Central limit theorem.
