From 8542aa185d825b9a567b5f6910d280852a4933eb Mon Sep 17 00:00:00 2001 From: Evgeny Kurnevsky Date: Sun, 29 Jan 2023 10:19:17 +0300 Subject: [PATCH] throttled: fix after recent update --- nixos/modules/services/hardware/throttled.nix | 2 +- 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