  Let Bun_G be the moduli space of G-bundles on a smooth complex projective
curve. Motivated by a study of boundary conditions in mirror symmetry, D.
Gaiotto associated to any symplectic representation of G a Lagrangian
subvariety of the cotangent bundle of Bun_G. We give a simple interpretation of
(a generalization of) Gaiotto's construction in terms of derived symplectic
geometry. This allows to consider a more general setting where symplectic
G-representations are replaced by arbitrary symplectic manifolds equipped with
a Hamiltonian G-action and with an action of the multiplicative group that
rescales the symplectic form with positive weight.
