  We develop techniques for describing the derived moduli spaces of solutions
to the equations of motion in twists of supersymmetric gauge theories as
derived algebraic stacks. We introduce a holomorphic twist of N=4
supersymmetric gauge theory and compute the derived moduli space. We then
compute the moduli spaces for the Kapustin-Witten topological twists as its
further twists. The resulting spaces for the A- and B-twist are closely related
to the de Rham stack of the moduli space of algebraic bundles and the de Rham
moduli space of flat bundles, respectively. In particular, we find the
unexpected result that the moduli spaces following a topological twist need not
be entirely topological, but can continue to capture subtle algebraic
structures of interest for the geometric Langlands program.
