The *correct* way to override the latest kernel config

OP’s last question was Is there a way to override the linux kernel used in linuxPackages_latest ? The obvious answer is “Yes, override linux_latest”.
This post seemed to imply that it does not work, or is incorrect.

AFAIK, the following should work and is at least a correct way to achieve his goal. If OP finds this unsatisfying, or if it does not work, I wanted to know why, just by sheer curiosity.

{
  boot.kernelPackages = pkgs.linuxPackages_latest;
  nixpkgs.config.packageOverrides = pkgs: {
    linux_latest = pkgs.linux_latest.override {
        extraConfig = ''
          LIRC y
        '';
    };
  };
}