The transference principle of Green and Tao enabled various authors to transfer Szemerédi's theorem on long arithmetic progressions in dense sets to various sparse sets of integers, mostly sparse sets of primes. In this paper, we provide a transference principle which applies to general affine-linear configurations of finite complexity.We illustrate the broad applicability of our transference principle with the case of almost twin primes, by which we mean either Chen primes or "bounded gap primes", as well as with the case of primes of the form x 2 + y 2 + 1. Thus, we show that in these sets of primes the existence of solutions to finite complexity systems of linear equations is determined by natural local conditions. These applications rely on a recent work of the last two authors on Bombieri-Vinogradov type estimates for nilsequences.PYB is grateful for the financial support and hospitality of the Max-Planck-Institute for Mathematics, Bonn.XS was supported by the NSF grant DMS-1802224.JT was supported by a Titchmarsh Research Fellowship. 1 We say that Ψ = (ψ1, . . . , ψt) is admissible if (ψi(n)) n∈Z d has no fixed prime divisor for each i ∈ [t].