We introduce the notion of generalized hyperpolygon, which arises as a representation, in the sense of Nakajima, of a comet-shaped quiver. We identify these representations with rigid geometric figures, namely pairs of polygons: one in the Lie algebra of a compact group and the other in its complexification. To such data, we associate an explicit meromorphic Higgs bundle on a genus-g Riemann surface, where g is the number of loops in the comet, thereby embedding the Nakajima quiver variety into a Hitchin system on a punctured genus-g Riemann surface (generally with positive codimension). We show that, under certain assumptions on flag types, the space of generalized hyperpolygons admits the structure of a completely integrable Hamiltonian system of Gelfand-Tsetlin type, inherited from the reduction of partial flag varieties. In the case where all flags are complete, we present the Hamiltonians explictly. We also remark upon the discretization of the Hitchin equations given by hyperpolygons, the construction of triple branes (in the sense of Kapustin-Witten mirror symmetry), and dualities between tame and wild Hitchin systems (in the sense of Painlevé transcendents).In memory of Sir Michael Atiyah , an inspiration to geometers the world round.