about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/bbswitch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/bbswitch')
-rw-r--r--pkgs/os-specific/linux/bbswitch/default.nix7
1 files changed, 3 insertions, 4 deletions
diff --git a/pkgs/os-specific/linux/bbswitch/default.nix b/pkgs/os-specific/linux/bbswitch/default.nix
index 7c5752b4e34e..8b4350fdb139 100644
--- a/pkgs/os-specific/linux/bbswitch/default.nix
+++ b/pkgs/os-specific/linux/bbswitch/default.nix
@@ -15,15 +15,14 @@ stdenv.mkDerivation {
   };
 
   preBuild = ''
-    kernelVersion=$(cd ${kernel}/lib/modules && ls)
     substituteInPlace Makefile \
-      --replace "\$(shell uname -r)" "${kernel.version}" \
+      --replace "\$(shell uname -r)" "${kernel.modDirVersion}" \
       --replace "/lib/modules" "${kernel}/lib/modules"
   '';
  
   installPhase = ''
-    ensureDir $out/lib/modules/${kernel.version}/misc
-    cp bbswitch.ko $out/lib/modules/${kernel.version}/misc
+    ensureDir $out/lib/modules/${kernel.modDirVersion}/misc
+    cp bbswitch.ko $out/lib/modules/${kernel.modDirVersion}/misc
 
     ensureDir $out/bin
     tee $out/bin/discrete_vga_poweroff << EOF