{ fetchFromGitHub, kmod, python3Packages, stdenv, }: stdenv.mkDerivation rec { pname = "throttled"; version = "git"; src = fetchFromGitHub { owner = "erpalma"; repo = pname; rev = "1dd726672f0b11b813d4c7b63e0157becde7a013"; hash = "sha256-0MsPp6y4r/uZB2SplKV+SAiJoxIs2jgOQmQoQQ2ZKwI="; }; nativeBuildInputs = with python3Packages; [wrapPython]; pythonPath = [kmod] ++ (with python3Packages; [configparser dbus-python pygobject3]); installPhase = '' runHook preInstall install -Dm755 -t $out/opt/throttled throttled.py install -Dm644 -t $out/opt/throttled mmio.py runHook postInstall ''; postFixup = '' wrapPythonProgramsIn $out/opt/throttled "$out $pythonPath" ''; }