linuxKernel.packages.lenovo-legion: init at 2023-04-02-16-53-51

linuxKernel.packages.lenovo-legion: init at 2023-04-02-16-53-51
This commit is contained in:
Ulrik Strid 2023-05-31 11:31:23 +02:00 committed by GitHub
commit 2de862f146
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,48 @@
{ lib, fetchFromGitHub, xorg, libsForQt5, wrapQtAppsHook, python3 }:
python3.pkgs.buildPythonApplication rec {
pname = "lenovo-legion-app";
version = "2023-04-02-16-53-51";
src = fetchFromGitHub {
owner = "johnfanv2";
repo = "LenovoLegionLinux";
rev = "main${version}";
sha256 = "sha256-s4JFFmawokdC4qoqNvZDhuJSinhQ3YKSIfAYi79VTTA=";
};
sourceRoot = "source/python/legion_linux";
nativeBuildInputs = [ wrapQtAppsHook ];
propagatedBuildInputs = with python3.pkgs; [
pyqt5
argcomplete
pyyaml
xorg.libxcb
libsForQt5.qtbase
];
postInstall = ''
cp -r ./{legion.py,legion_cli.py,legion_gui.py} $out/${python3.sitePackages}
cp ./legion_logo.png $out/${python3.sitePackages}/legion_logo.png
rm -rf $out/data
'';
dontWrapQtApps = true;
preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
meta = {
description = "An utility to control Lenovo Legion laptop";
homepage = "https://github.com/johnfanv2/LenovoLegionLinux";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.ulrikstrid ];
mainProgram = "legion_gui";
};
}

View file

@ -0,0 +1,34 @@
{ 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";
};
}

View file

@ -32151,6 +32151,8 @@ with pkgs;
lemonbar-xft = callPackage ../applications/window-managers/lemonbar/xft.nix { };
lenovo-legion = libsForQt5.callPackage ../os-specific/linux/lenovo-legion/app.nix { };
legitify = callPackage ../development/tools/legitify { };
lens = callPackage ../applications/networking/cluster/lens { };

View file

@ -375,6 +375,8 @@ in {
kvdo = callPackage ../os-specific/linux/kvdo {};
lenovo-legion-module = callPackage ../os-specific/linux/lenovo-legion { };
liquidtux = callPackage ../os-specific/linux/liquidtux {};
lkrg = callPackage ../os-specific/linux/lkrg {};