Adding features attribute to a kernel with custom config

Hi,

i tried building a kernel with a custom .config file, using linuxManualConfig. However, as i have programs.steam.enable = true; the build fails with this error:

       error:
       Failed assertions:
       - `hardware.graphics.enable32Bit` requires a kernel that supports 32-bit emulation

I’ve figured out that I need to specify support for ia32Emulation in the “features” attribute of the kernel, but I can’t get it to work. After reading the wiki and the source code of buildLinux, i came up with the following configuration:

  boot.kernelPackages = let
    kernel_pkg = { fetchurl, linuxManualConfig, ...}:
      linuxManualConfig ({
        allowImportFromDerivation = true;

        version = "6.14.11";
        src = fetchurl {
          url = "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.14.11.tar.xz";
          hash = "sha256-PxzNCm3JyXd8tvzvNXx35KI4bITFK21bvNp5wWrzOxs=";
        };
        configfile = ./config;
      });
    passthru = {
      features = {
        ia32Emulation = true;
      };
      passthru = kernel.passthru // (removeAttrs passthru [ "passthru" ]);
    };
    kernel = pkgs.callPackage kernel_pkg {};
  in pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor (lib.extendDerivation true passthru kernel));

I’m not familiar with functional languages, so i may be missing something. However, by checking the end result with builtins.trace, it appears to be the same as a pkg in linuxPackages.