2020-04-07 10:55:56 +01:00
|
|
|
{ stdenv, fetchFromGitHub, kernel }:
|
2010-11-11 22:00:57 +00:00
|
|
|
|
2020-04-07 10:55:56 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "acpi-call";
|
|
|
|
version = "2020-04-07-${kernel.version}";
|
2012-02-17 14:32:28 +00:00
|
|
|
|
2020-04-07 10:55:56 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "acpi_call";
|
|
|
|
rev = "3d7c9fe5ed3fc5ed5bafd39d54b1fdc7a09ce710";
|
|
|
|
sha256 = "09kp8zl392h99wjwzqrdw2xcfnsc944hzmfwi8n1y7m2slpdybv3";
|
2010-11-11 22:00:57 +00:00
|
|
|
};
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "pic" ];
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2018-01-01 21:03:53 +00:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2020-04-07 10:55:56 +01:00
|
|
|
makeFlags = [
|
|
|
|
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
];
|
2017-09-05 12:14:15 +01:00
|
|
|
|
2010-11-11 22:00:57 +00:00
|
|
|
installPhase = ''
|
2020-04-07 10:55:56 +01: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-11 22:00:57 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-07 10:55:56 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
maintainers = with maintainers; [ raskin mic92 ];
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
platforms = platforms.linux;
|
2010-11-11 22:00:57 +00:00
|
|
|
description = "A module allowing arbitrary ACPI calls; use case: hybrid video";
|
|
|
|
};
|
|
|
|
}
|