throttled: fix after recent update
This commit is contained in:
parent
f5f566d0ff
commit
8542aa185d
2 changed files with 7 additions and 3 deletions
|
@ -20,7 +20,7 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.packages = [ pkgs.throttled ];
|
systemd.packages = [ pkgs.throttled ];
|
||||||
# The upstream package has this in Install, but that's not enough, see the NixOS manual
|
# 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 =
|
environment.etc."throttled.conf".source =
|
||||||
if cfg.extraConfig != ""
|
if cfg.extraConfig != ""
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, python3Packages }:
|
{ lib, stdenv, fetchFromGitHub, python3Packages, pciutils }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "throttled";
|
pname = "throttled";
|
||||||
|
@ -20,7 +20,11 @@ stdenv.mkDerivation rec {
|
||||||
];
|
];
|
||||||
|
|
||||||
# The upstream unit both assumes the install location, and tries to run in a virtualenv
|
# 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 = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
Loading…
Reference in a new issue