Shouldn’t happen. Certainly not based on the snippets you’ve provided.
It’s just used to determine the latest compatible version.
Just to confirm: I put my own suggestion in my configuration.nix
and rebuilt a 5.15 kernel with zfs without issue. Note the inconsistent kernel versions error could be caused by any module - it doesn’t have to be zfs.
There must be something else to your config - can you share the full/more of your configuration.nix
?