We talked about this a bit a couple of sundays ago.
Psi-Shock: Any unit with the Pskyer, Brotherhood of Psykers or Psychic Pilot special rules that is hit by a weapon with this special rule suffers the Perils of the Warp in addition to any other damage.
Since none of those three rules transfer from IC to unit, the perils would occur on a model after a shot that was allocated to a psyker, either through it being closest, a look out sir, or a precision shot that wasn't look-out-sir'ed away, etc. Since it's all one unit, you'd suffer one perils on whomever was determined to be hit (in the case of people who aren't BoP). That's how I'd do it, and Chris can obviously disagree with me, but the RAW alternative to that is that a librarian in a unit of tactical marines can never be hurt by it until all the tactical marines are dead, because tactical marines do not have any of those rules.