11 , common-updater-scripts
15 stdenv.mkDerivation rec {
16 name = "tp_smapi-${version}-${kernel.version}";
19 src = fetchFromGitHub {
20 owner = "linux-thinkpad";
22 rev = "tp-smapi/${version}";
23 sha256 = "1rjb0njckczc2mj05cagvj0lkyvmyk6bw7wkiinv81lw8m90g77g";
27 # update DEFINE_SEMAPHORE usage for linux 6.4+
28 # https://github.com/linux-thinkpad/tp_smapi/pull/45
30 url = "https://github.com/linux-thinkpad/tp_smapi/commit/0c3398b1acf2a2cabd9cee91dc3fe3d35805fa8b.patch";
31 hash = "sha256-J/WvijrpHGwFOZMMxnHdNin5eh8vViTcNb4nwsCqsLs=";
35 nativeBuildInputs = kernel.moduleBuildDependencies;
37 hardeningDisable = [ "pic" ];
40 "KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}"
41 "SHELL=${stdenv.shell}"
46 install -v -D -m 644 thinkpad_ec.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/thinkpad_ec.ko"
47 install -v -D -m 644 tp_smapi.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/tp_smapi.ko"
48 install -v -D -m 644 hdaps.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/hdapsd.ko"
53 enableParallelBuilding = true;
55 passthru.updateScript = import ./update.nix {
56 inherit lib writeScript coreutils gnugrep jq curl common-updater-scripts runtimeShell;
60 description = "IBM ThinkPad hardware functions driver";
61 homepage = "https://github.com/linux-thinkpad/tp_smapi";
62 license = lib.licenses.gpl2Plus;
64 # driver is only ment for linux thinkpads i think bellow platforms should cover it.
65 platforms = [ "x86_64-linux" "i686-linux" ];