summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Kurnevsky <kurnevsky@gmail.com>2023-01-29 10:19:17 +0300
committerEvgeny Kurnevsky <kurnevsky@gmail.com>2023-01-29 10:25:08 +0300
commit8542aa185d825b9a567b5f6910d280852a4933eb (patch)
tree0d357df2e9918b18361bf589889ca6b5ae0b9db7
parentf5f566d0ff72409a90b52a610e85b8d8c7182651 (diff)
throttled: fix after recent update
-rw-r--r--nixos/modules/services/hardware/throttled.nix2
-rw-r--r--pkgs/tools/system/throttled/default.nix8
2 files changed, 7 insertions, 3 deletions
diff --git a/nixos/modules/services/hardware/throttled.nix b/nixos/modules/services/hardware/throttled.nix
index 2d801a7e838f..afca24d976e1 100644
--- a/nixos/modules/services/hardware/throttled.nix
+++ b/nixos/modules/services/hardware/throttled.nix
@@ -20,7 +20,7 @@ in {
config = mkIf cfg.enable {
systemd.packages = [ pkgs.throttled ];
# The upstream package has this in Install, but that's not enough, see the NixOS manual
- systemd.services.lenovo_fix.wantedBy = [ "multi-user.target" ];
+ systemd.services.throttled.wantedBy = [ "multi-user.target" ];
environment.etc."throttled.conf".source =
if cfg.extraConfig != ""
diff --git a/pkgs/tools/system/throttled/default.nix b/pkgs/tools/system/throttled/default.nix
index efbc9ed3dd3f..f09c0480865f 100644
--- a/pkgs/tools/system/throttled/default.nix
+++ b/pkgs/tools/system/throttled/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, python3Packages }:
+{ lib, stdenv, fetchFromGitHub, python3Packages, pciutils }:
stdenv.mkDerivation rec {
pname = "throttled";
@@ -20,7 +20,11 @@ stdenv.mkDerivation rec {
];
# The upstream unit both assumes the install location, and tries to run in a virtualenv
- postPatch = ''sed -e 's|ExecStart=.*|ExecStart=${placeholder "out"}/bin/throttled.py|' -i systemd/throttled.service'';
+ postPatch = ''
+ sed -e 's|ExecStart=.*|ExecStart=${placeholder "out"}/bin/throttled.py|' -i systemd/throttled.service
+
+ substituteInPlace throttled.py --replace "'setpci'" "'${pciutils}/bin/setpci'"
+ '';
installPhase = ''
runHook preInstall