about summary refs log tree commit diff
path: root/pkgs/tools/system
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2019-06-11 11:10:52 +0100
committerGitHub <noreply@github.com>2019-06-11 11:10:52 +0100
commite829aeefa35cb1c0b321c08e5b4dd2825911c050 (patch)
treea05f00d86e9a4746d08c0a999f60f783bae81826 /pkgs/tools/system
parent538af5ab7048d09cb665ce58aec732a4d30ee121 (diff)
parentefbd890f991c36f53dfd08f3229952e17fb95d4f (diff)
downloadnixlib-e829aeefa35cb1c0b321c08e5b4dd2825911c050.tar
nixlib-e829aeefa35cb1c0b321c08e5b4dd2825911c050.tar.gz
nixlib-e829aeefa35cb1c0b321c08e5b4dd2825911c050.tar.bz2
nixlib-e829aeefa35cb1c0b321c08e5b4dd2825911c050.tar.lz
nixlib-e829aeefa35cb1c0b321c08e5b4dd2825911c050.tar.xz
nixlib-e829aeefa35cb1c0b321c08e5b4dd2825911c050.tar.zst
nixlib-e829aeefa35cb1c0b321c08e5b4dd2825911c050.zip
Merge pull request #62101 from michaelpj/imp/lenovo-throttled
throttled: fix for Intel CPU throttling issues
Diffstat (limited to 'pkgs/tools/system')
-rw-r--r--pkgs/tools/system/throttled/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/tools/system/throttled/default.nix b/pkgs/tools/system/throttled/default.nix
new file mode 100644
index 000000000000..4f52b5e09455
--- /dev/null
+++ b/pkgs/tools/system/throttled/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchFromGitHub, python3Packages }:
+
+stdenv.mkDerivation rec {
+  pname = "throttled";
+  version = "0.6";
+
+  src = fetchFromGitHub {
+    owner = "erpalma";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1icb2288pj25vbdnd16zvisw9c01hp8vkk25ilkc74gy76xhpcs4";
+  };
+
+  nativeBuildInputs = [ python3Packages.wrapPython ];
+
+  pythonPath = with python3Packages; [ 
+    configparser
+    dbus-python
+    pygobject3
+  ];
+
+  # The upstream unit both assumes the install location, and tries to run in a virtualenv 
+  postPatch = ''sed -e 's|ExecStart=.*|ExecStart=${placeholder "out"}/bin/lenovo_fix.py|' -i systemd/lenovo_fix.service'';
+
+  installPhase = ''
+    runHook preInstall
+    install -D -m755 -t $out/bin lenovo_fix.py
+    install -D -t $out/bin lenovo_fix.py mmio.py
+    install -D -m644 -t $out/etc etc/*
+    install -D -m644 -t $out/lib/systemd/system systemd/*
+    runHook postInstall
+  '';
+
+  postFixup = ''wrapPythonPrograms'';
+
+  meta = with stdenv.lib; {
+    description = "Fix for Intel CPU throttling issues";
+    homepage = https://github.com/erpalma/throttled;
+    license = licenses.mit;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ michaelpj ];
+  };
+}