Fix some instances of #33166 correctly

+6 -8
+2 -2
pkgs/os-specific/linux/bbswitch/default.nix
··· 1 - { stdenv, fetchurl, fetchpatch, kernel, libelf }: 1 + { stdenv, fetchurl, fetchpatch, kernel }: 2 2 3 3 let 4 4 baseName = "bbswitch"; ··· 20 20 sha256 = "1lbr6pyyby4k9rn2ry5qc38kc738d0442jhhq57vmdjb6hxjya7m"; 21 21 }) ]; 22 22 23 - buildInputs = [ libelf ]; 23 + nativeBuildInputs = kernel.moduleBuildDependencies; 24 24 25 25 hardeningDisable = [ "pic" ]; 26 26
+2 -4
pkgs/os-specific/linux/nvidia-x11/generic.nix
··· 12 12 }: 13 13 14 14 { stdenv, callPackage, callPackage_i686, fetchurl, fetchpatch 15 - , kernel ? null, libelf, xorg, zlib, perl, nukeReferences 15 + , kernel ? null, xorg, zlib, perl, nukeReferences 16 16 , # Whether to build the libraries only (i.e. not the kernel module or 17 17 # nvidia-settings). Used to support 32-bit binaries on 64-bit 18 18 # Linux. ··· 62 62 63 63 libPath = makeLibraryPath [ xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib stdenv.cc.cc ]; 64 64 65 - nativeBuildInputs = [ perl nukeReferences ]; 66 - 67 - buildInputs = [ libelf ]; 65 + nativeBuildInputs = [ perl nukeReferences ] ++ kernel.moduleBuildDependencies; 68 66 69 67 disallowedReferences = optional (!libsOnly) [ kernel.dev ]; 70 68
+2 -2
pkgs/os-specific/linux/wireguard/default.nix
··· 1 - { stdenv, fetchurl, libmnl, libelf, kernel ? null }: 1 + { stdenv, fetchurl, libmnl, kernel ? null }: 2 2 3 3 # module requires Linux >= 3.10 https://www.wireguard.io/install/#kernel-requirements 4 4 assert kernel != null -> stdenv.lib.versionAtLeast kernel.version "3.10"; ··· 37 37 38 38 NIX_CFLAGS = ["-Wno-error=cpp"]; 39 39 40 - buildInputs = [ libelf ]; 40 + nativeBuildInputs = kernel.moduleBuildDependencies; 41 41 42 42 buildPhase = "make module"; 43 43 };