depot/third_party/nixpkgs/pkgs/os-specific/linux/framework-laptop-kmod/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

38 lines
1 KiB
Nix

{ lib
, stdenv
, linuxPackages
, kernel
, fetchFromGitHub
}:
stdenv.mkDerivation rec {
pname = "framework-laptop-kmod";
version = "unstable-2023-12-03";
src = fetchFromGitHub {
owner = "DHowett";
repo = "framework-laptop-kmod";
rev = "d5367eb9e5b5542407494d04ac1a0e77f10cc89d";
hash = "sha256-t8F4XHPkuCjWBrsEjW97ielYtf3V6hlLsrasvyab198=";
};
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = kernel.makeFlags ++ [
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
installPhase = ''
runHook preInstall
install -D framework_laptop.ko -t $out/lib/modules/${kernel.modDirVersion}/extra
runHook postInstall
'';
meta = with lib; {
description = "A kernel module that exposes the Framework Laptop (13, 16)'s battery charge limit and LEDs to userspace.";
homepage = "https://github.com/DHowett/framework-laptop-kmod";
license = licenses.gpl2;
maintainers = with maintainers; [ gaykitty ];
platforms = platforms.linux;
};
}