2021-01-11 10:54:33 +03:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel }:
|
2010-11-12 01:00:57 +03:00
|
|
|
|
2020-04-07 12:55:56 +03:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "acpi-call";
|
2021-08-24 21:26:28 +03:00
|
|
|
version = "1.2.2";
|
2021-03-15 16:07:22 +03:00
|
|
|
name = "${pname}-${version}-${kernel.version}";
|
2012-02-17 18:32:28 +04:00
|
|
|
|
2020-04-07 12:55:56 +03:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "acpi_call";
|
2021-03-15 16:07:22 +03:00
|
|
|
rev = "v${version}";
|
2021-08-24 21:26:28 +03:00
|
|
|
sha256 = "1s7h9y3adyfhw7cjldlfmid79lrwz3vqlvziw9nwd6x5qdj4w9vp";
|
2010-11-12 01:00:57 +03:00
|
|
|
};
|
2015-12-23 04:59:47 +03:00
|
|
|
|
2016-02-26 20:38:15 +03:00
|
|
|
hardeningDisable = [ "pic" ];
|
2015-12-23 04:59:47 +03:00
|
|
|
|
2018-01-02 00:03:53 +03:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2021-12-23 23:37:47 +03:00
|
|
|
makeFlags = kernel.makeFlags ++ [
|
2020-04-07 12:55:56 +03:00
|
|
|
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
];
|
2017-09-05 14:14:15 +03:00
|
|
|
|
2010-11-12 01:00:57 +03:00
|
|
|
installPhase = ''
|
2020-04-07 12:55:56 +03:00
|
|
|
install -D acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc/acpi_call.ko
|
|
|
|
install -D -m755 examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh
|
2010-11-12 01:00:57 +03:00
|
|
|
'';
|
|
|
|
|
2021-01-11 10:54:33 +03:00
|
|
|
meta = with lib; {
|
2020-04-07 12:55:56 +03:00
|
|
|
maintainers = with maintainers; [ raskin mic92 ];
|
2021-03-15 16:14:49 +03:00
|
|
|
homepage = "https://github.com/nix-community/acpi_call";
|
2020-04-07 12:55:56 +03:00
|
|
|
platforms = platforms.linux;
|
2010-11-12 01:00:57 +03:00
|
|
|
description = "A module allowing arbitrary ACPI calls; use case: hybrid video";
|
2021-03-15 16:14:49 +03:00
|
|
|
license = licenses.gpl3Plus;
|
2010-11-12 01:00:57 +03:00
|
|
|
};
|
|
|
|
}
|