{ fetchFromGitHub, kmod, python3, stdenv, }: stdenv.mkDerivation rec { pname = "throttled"; version = "unstable-2022-06-30"; src = fetchFromGitHub { owner = "erpalma"; repo = pname; rev = "ab9641a93a409bdc7fca6889ff23ca5a685e5a77"; hash = "sha256-Zd+rTsVDkw9mq6k2OkMy+HxyYsl3ADy1fEM/1e/jxAs="; }; nativeBuildInputs = with python3.pkgs; [wrapPython]; pythonPath = (with python3.pkgs; [configparser dbus-python pygobject3]) ++ [kmod]; 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" ''; }