Merge pull request #213317 from kurnevsky/throttled

throttled: fix after recent update

Changed files
+7 -3
nixos
modules
services
hardware
pkgs
tools
system
throttled
+1 -1
nixos/modules/services/hardware/throttled.nix
···
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 != ""
+6 -2
pkgs/tools/system/throttled/default.nix
···
-
{ lib, stdenv, fetchFromGitHub, python3Packages }:
+
{ lib, stdenv, fetchFromGitHub, python3Packages, pciutils }:
stdenv.mkDerivation rec {
pname = "throttled";
···
];
# 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