depot/third_party/nixpkgs/pkgs/os-specific/linux/lenovo-legion/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

34 lines
1.1 KiB
Nix

{ lib, fetchurl, stdenv, kernel, bash, lenovo-legion }:
stdenv.mkDerivation {
pname = "lenovo-legion-module";
inherit (lenovo-legion) version src;
sourceRoot = "source/kernel_module";
hardeningDisable = [ "pic" ];
preConfigure = ''
sed -i -e '/depmod/d' ./Makefile
'';
makeFlags = kernel.makeFlags ++ [
"SHELL=bash"
"KERNELVERSION=${kernel.modDirVersion}"
"KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"INSTALLDIR=${placeholder "out"}/lib/modules/${kernel.modDirVersion}/kernel/drivers/platform/x86"
"MODDESTDIR=${placeholder "out"}/lib/modules/${kernel.modDirVersion}/kernel/drivers/platform/x86"
"DKMSDIR=${placeholder "out"}/lib/modules/${kernel.modDirVersion}/misc"
];
nativeBuildInputs = kernel.moduleBuildDependencies;
meta = {
description = "Linux kernel module for controlling fan and power in Lenovo Legion laptops";
homepage = "https://github.com/johnfanv2/LenovoLegionLinux";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.ulrikstrid ];
broken = kernel.kernelOlder "5.15";
};
}