depot/pkgs/os-specific/linux/lenovo-legion/app.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

65 lines
1.5 KiB
Nix

{
lib,
fetchFromGitHub,
xorg,
wrapQtAppsHook,
python3,
}:
python3.pkgs.buildPythonApplication rec {
pname = "lenovo-legion-app";
version = "0.0.18";
src = fetchFromGitHub {
owner = "johnfanv2";
repo = "LenovoLegionLinux";
rev = "e9c1d8157a7b25e4334d0b1d887338c670e39f6a";
hash = "sha256-6JYOTDzz9/flyEDQo1UPjWT5+Cuea5fsdbdc6AooDxU=";
};
sourceRoot = "${src.name}/python/legion_linux";
nativeBuildInputs = [ wrapQtAppsHook ];
propagatedBuildInputs = with python3.pkgs; [
pyqt6
argcomplete
pyyaml
darkdetect
xorg.libxcb
];
postPatch = ''
# only fixup application (legion-linux-gui), service (legiond) currently not installed so do not fixup
# version
substituteInPlace ./setup.cfg \
--replace-fail "_VERSION" "${version}"
# /etc
substituteInPlace ./legion_linux/legion.py \
--replace-fail "/etc/legion_linux" "$out/share/legion_linux"
# /usr
substituteInPlace ./legion_linux/legion_gui.desktop \
--replace-fail "Icon=/usr/share/pixmaps/legion_logo.png" "Icon=legion_logo"
'';
dontWrapQtApps = true;
preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
meta = {
description = "Utility to control Lenovo Legion laptop";
homepage = "https://github.com/johnfanv2/LenovoLegionLinux";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
ulrikstrid
realsnick
chn
];
mainProgram = "legion_gui";
};
}