2021-06-07 20:42:14 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, wrapGAppsHook
|
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, cmake
|
|
|
|
, gobject-introspection
|
|
|
|
, desktop-file-utils
|
|
|
|
, python3
|
|
|
|
, gtk3
|
|
|
|
, libdazzle
|
|
|
|
, libappindicator-gtk3
|
|
|
|
, libnotify
|
|
|
|
, nvidia_x11
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pythonEnv = python3.withPackages (pypkgs: with pypkgs; [
|
|
|
|
injector
|
|
|
|
matplotlib
|
|
|
|
peewee
|
|
|
|
pynvml
|
|
|
|
pygobject3
|
|
|
|
xlib
|
|
|
|
pyxdg
|
|
|
|
requests
|
|
|
|
rx
|
|
|
|
gtk3
|
|
|
|
]);
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "gwe";
|
2022-04-04 22:29:09 +02:00
|
|
|
version = "0.15.5";
|
2021-06-07 20:42:14 +02:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "leinardi";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-04-04 22:29:09 +02:00
|
|
|
sha256 = "sha256-bey/G+muDZsMMU3lVdNS6E/BnAJr29zLPE0MMT4sh1c=";
|
2021-06-07 20:42:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
patchShebangs scripts/{make_local_manifest,meson_post_install}.py
|
|
|
|
|
|
|
|
substituteInPlace gwe/repository/nvidia_repository.py \
|
|
|
|
--replace "from py3nvml import py3nvml" "import pynvml" \
|
|
|
|
--replace "py3nvml.py3nvml" "pynvml" \
|
|
|
|
--replace "py3nvml" "pynvml"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapGAppsHook
|
|
|
|
pkg-config
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
cmake
|
|
|
|
gobject-introspection
|
|
|
|
desktop-file-utils
|
|
|
|
pythonEnv
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gtk3
|
|
|
|
libdazzle
|
|
|
|
libappindicator-gtk3
|
|
|
|
libnotify
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/gwe $out/lib/gwe-bin
|
|
|
|
|
|
|
|
makeWrapper ${pythonEnv}/bin/python $out/bin/gwe \
|
|
|
|
--add-flags "$out/lib/gwe-bin" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "/run/opengl-driver/lib" \
|
|
|
|
--prefix PATH : "${builtins.concatStringsSep ":" [ (lib.makeBinPath [ nvidia_x11 nvidia_x11.settings ]) "/run/wrappers/bin" ]}" \
|
|
|
|
--unset "SHELL" \
|
|
|
|
''${gappsWrapperArgs[@]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "System utility designed to provide information, control the fans and overclock your NVIDIA card";
|
|
|
|
homepage = "https://gitlab.com/leinardi/gwe";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = [ maintainers.ivar ];
|
|
|
|
};
|
|
|
|
}
|