depot/third_party/nixpkgs/pkgs/os-specific/linux/lenovo-legion/default.nix
Default email 5e9e1146e1 Project import generated by Copybara.
GitOrigin-RevId: 18036c0be90f4e308ae3ebcab0e14aae0336fe42
2023-08-05 00:07:22 +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 = "${lenovo-legion.src.name}/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";
};
}