For developing rust kernel modules, there are some useful targets in .../source/rust/Makefile, but when I list the rust directory I get:
$ ls "$(nix build nixpkgs#linuxPackages.kernel.dev --no-link --print-out-paths)/lib/modules/6.12.26/source/rust"
total 8
dr-xr-xr-x 2 root root 4096 Jan 1 1970 bindings
dr-xr-xr-x 2 root root 4096 Jan 1 1970 uapi
Note that:
$ nix eval nixpkgs#linuxPackages.kernel.withRust
true
Currently, to get access to the source I am just doing it directly via:
kernelsrc = pkgs.runCommandCC "kernelsrc" { } ''
mkdir $out
tar -xvf ${kernel.src} -C $out --strip-components=1
''
Which gives me access to the files as listed here.