linuxPackages.acer-wmi-battery: init at 0.1.0-unstable-2025-04-24

This commit is contained in:
Peter H. Hoeg
2025-04-16 12:11:13 +02:00
committed by Peter Hoeg
parent 77a2b77c49
commit 87cb7095bf
2 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
{
stdenv,
lib,
fetchFromGitHub,
kernel,
}:
let
release = "0.1.0-unstable-2025-04-24";
in
stdenv.mkDerivation {
pname = "acer-wmi-battery";
version = "${kernel.version}-${release}";
src = fetchFromGitHub {
owner = "frederik-h";
repo = "acer-wmi-battery";
rev = "0889d3ea54655eaa88de552b334911ce7375952f";
hash = "sha256-mI6Ob9BmNfwqT3nndWf3jkz8f7tV10odkTnfApsNo+A=";
};
postPatch = ''
substituteInPlace Makefile \
--replace-fail '/lib/modules/$(shell uname -r)/build' ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build
'';
enableParallelBuilding = true;
installPhase = ''
runHook preInstall
find . -name '*.ko' -exec xz -f {} \;
install -Dm444 -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/platform/x86 *.ko.xz
runHook postInstall
'';
meta = {
description = "Driver for the Acer WMI battery health control interface";
homepage = "https://github.com/frederik-h/acer-wmi-battery";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ peterhoeg ];
};
}

View File

@@ -364,6 +364,8 @@ in
inherit (pkgs) oci-seccomp-bpf-hook; # added 2022-11
inherit (pkgs) dpdk; # added 2024-03
acer-wmi-battery = callPackage ../os-specific/linux/acer-wmi-battery { };
acpi_call = callPackage ../os-specific/linux/acpi-call { };
ajantv2 = callPackage ../os-specific/linux/ajantv2 { };