I'm not sure precisely in what micro-version the API change was made, so the check for 3.18.0 and above may not be quite correct. But it's at least sufficient for every version currently included in NixOS.
It makes several API fixes for several kernel versions so stop trying to enumerate them all in the filename.