https://nixos.org/manual/nixpkgs/stable/#sec-linux-kernel says that there’s a function named pkgs.linuxManualConfig that can be used when “most of the common configuration has to be altered or disabled to achieve a kernel as expected by the target use case”, which is the situation I am in right now. It goes on to say that if you think you need this you should read the source code of the function very carefully, with a link into the nixpkgs Github repo – and that link is broken. It points at https://github.com/NixOS/nixpkgs/blob/d77bda728d5041c1294a68fb25c79e2d161f62b9/pkgs/os-specific/linux/kernel/build.nix, which brings up a 404 page for me.
If I look at the nixos-25.11 branch instead, pkgs/os-specific/linux/kernel/build.nix does exist, but it doesn’t appear to define a function named linuxManualConfig. Code search doesn’t find anything else that defines that function either. There is a file named pkgs/os-specific/linux/kernel/manual-config.nix on the 25.11 branch, but it doesn’t seem to be used by anything whatsoever.
So this is like 75% documentation bug report – the nixpkgs manual section on building custom kernels is out of date – and 25% plea for help: in 25.11 and going forward, how am I supposed to build a custom kernel if I want to start from scratch with the kernel configuration? (Ideally, also, without having to adjust configuration.nix every time the 25.11 channel pushes some kernel bugfixes.)