forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
34 lines
950 B
Nix
34 lines
950 B
Nix
{ lib, stdenv, fetchFromGitHub, kernel }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "acpi-call";
|
|
version = "2020-04-07-${kernel.version}";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "nix-community";
|
|
repo = "acpi_call";
|
|
rev = "3d7c9fe5ed3fc5ed5bafd39d54b1fdc7a09ce710";
|
|
sha256 = "09kp8zl392h99wjwzqrdw2xcfnsc944hzmfwi8n1y7m2slpdybv3";
|
|
};
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
makeFlags = [
|
|
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
];
|
|
|
|
installPhase = ''
|
|
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
|
|
'';
|
|
|
|
meta = with lib; {
|
|
maintainers = with maintainers; [ raskin mic92 ];
|
|
inherit (src.meta) homepage;
|
|
platforms = platforms.linux;
|
|
description = "A module allowing arbitrary ACPI calls; use case: hybrid video";
|
|
};
|
|
}
|