Let $X$ be a smooth projective variety over $\mathbb{F}_p$. A basic (and very important) theorem is that we have equality $$ \# X(\mathbb{F}_{p^n}) = \sum_{i=0}^{2\dim X} (1)^i \operatorname{tr}({\Phi^\ast}^n,\operatorname{H}_{et}^i(X,\mathbb{Q}_\ell)) $$ where $\ell$ is a prime distinct from $p$ and $\Phi:X\to X$ is the Frobenius. One takes as motivation the Lefschetz fixed point theorem in algebraic topology, which says that if $X$ is compact and $f:X\to X$ is a continuous map with finitely many non-degenerate fixed points, then $$ \# X^f = \sum (-1)^i \operatorname{tr}(f^\ast,\operatorname{H}^i(X,\mathbb{Q})) $$
My understanding is that both theorems admit generalizations. Let $f:X\to X$ be an arbitrary regular map on a smooth projective variety over some field $k$. Let $\ell$ be a prime invertible in $k$. Then we have $$ (\Gamma_f \cdot \Delta_X) = \sum (-1)^i \operatorname{tr}(f^\ast,\operatorname{H}_{et}^i(X,\mathbb{Q}_\ell)) $$ and the same should hold for maps on compact topological spaces (maybe compact oriented manifolds). My question is:
Is there a good reference for the generalized Lefschetz-Hopf fixed point theorem (in algebraic topology)?
Even better would be a "sheafy" reference.
(A good reference for this in algebraic geometry is SGA 5, III.4.)