Make custom kernel build with custom configuration

Same question here. Stuck there as well Are they steps missing integrating usbip support in NixOS-WSL ? · nix-community/NixOS-WSL · Discussion #110 · GitHub

How would I build this file ?

@pekkari in your case did you try sudo nixos-rebuild test -I nixos-config=./your_hardened_kernel.nix already ? For extraStructuredConfig see The *correct* way to override the latest kernel config - #9 by julm and Linux kernel - NixOS Wiki (called structuredExtraConfig there).