diff options
author | Martin Weinelt <mweinelt@users.noreply.github.com> | 2023-02-01 01:37:20 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-01 01:37:20 +0000 |
commit | a85007b25303a395d1d92486d163c13b40e7733c (patch) | |
tree | b6a71361e163a3978df6ef0366b6d0d1e6f2b10f | |
parent | 25a9e5aef87ddd493be302d7fafef14a57736eb1 (diff) | |
parent | 8542aa185d825b9a567b5f6910d280852a4933eb (diff) |
Merge pull request #213317 from kurnevsky/throttled
throttled: fix after recent update
-rw-r--r-- | nixos/modules/services/hardware/throttled.nix | 2 | ||||
-rw-r--r-- | pkgs/tools/system/throttled/default.nix | 8 |
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 |