summary refs log tree commit diff
path: root/pkgs/os-specific/linux/bbswitch/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/bbswitch/default.nix')
-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 a8f8a9d33ef..7c5752b4e34 100644
--- a/pkgs/os-specific/linux/bbswitch/default.nix
+++ b/pkgs/os-specific/linux/bbswitch/default.nix
@@ -17,14 +17,13 @@ stdenv.mkDerivation {
   preBuild = ''
     kernelVersion=$(cd ${kernel}/lib/modules && ls)
     substituteInPlace Makefile \
-      --replace "\$(shell uname -r)" "$kernelVersion" \
+      --replace "\$(shell uname -r)" "${kernel.version}" \
       --replace "/lib/modules" "${kernel}/lib/modules"
   '';
  
   installPhase = ''
-    kernelVersion=$(cd ${kernel}/lib/modules && ls)
-    ensureDir $out/lib/modules/$kernelVersion/misc
-    cp bbswitch.ko $out/lib/modules/$kernelVersion/misc
+    ensureDir $out/lib/modules/${kernel.version}/misc
+    cp bbswitch.ko $out/lib/modules/${kernel.version}/misc
 
     ensureDir $out/bin
     tee $out/bin/discrete_vga_poweroff << EOF