From 7810833d2d61319c8b1cf2abe043e1a8645035ce Mon Sep 17 00:00:00 2001 From: Yegor Timoshenko Date: Sun, 24 Dec 2017 01:22:48 +0000 Subject: [PATCH] t410: drop POWERTOP-like script in favor of services.tlp.enable tlp does the same thing, but dynamically, depending on whether power adapter is connected. It is also much more portable than this script. Direct replacement would be `powerManagement.powertop.enable`. --- lenovo/thinkpad/t410/default.nix | 56 -------------------------------- 1 file changed, 56 deletions(-) diff --git a/lenovo/thinkpad/t410/default.nix b/lenovo/thinkpad/t410/default.nix index b7a765d..ec8cbc7 100644 --- a/lenovo/thinkpad/t410/default.nix +++ b/lenovo/thinkpad/t410/default.nix @@ -30,61 +30,5 @@ hardware.cpu.intel.updateMicrocode = lib.mkDefault true; - systemd.services.tune-powermanagement = { - description = "Tune Powermanagement"; - serviceConfig.Type = "oneshot"; - serviceConfig.RemainAfterExit = true; - wantedBy = [ "multi-user.target" ]; - unitConfig.RequiresMountsFor = "/sys"; - script = '' - echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs' - echo '1' > '/sys/module/snd_hda_intel/parameters/power_save' - echo 'auto' > '/sys/bus/i2c/devices/i2c-0/device/power/control' - echo 'auto' > '/sys/bus/i2c/devices/i2c-1/device/power/control' - echo 'auto' > '/sys/bus/i2c/devices/i2c-2/device/power/control' - echo 'auto' > '/sys/bus/i2c/devices/i2c-3/device/power/control' - echo 'auto' > '/sys/bus/i2c/devices/i2c-4/device/power/control' - echo 'auto' > '/sys/bus/i2c/devices/i2c-5/device/power/control' - echo 'auto' > '/sys/bus/i2c/devices/i2c-6/device/power/control' - echo 'auto' > '/sys/bus/i2c/devices/i2c-7/device/power/control' - echo 'auto' > '/sys/bus/i2c/devices/i2c-8/device/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:02.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:16.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:16.3/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:19.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1a.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1b.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.1/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.3/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.4/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1e.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.2/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.3/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.6/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:03:00.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:0d:00.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:0d:00.1/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:ff:00.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:ff:00.1/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:ff:02.0/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:ff:02.1/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:ff:02.2/power/control' - echo 'auto' > '/sys/bus/pci/devices/0000:ff:02.3/power/control' - echo 'auto' > '/sys/bus/usb/devices/1-1.3/power/control' - echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy' - echo 'min_power' > '/sys/class/scsi_host/host1/link_power_management_policy' - echo 'min_power' > '/sys/class/scsi_host/host2/link_power_management_policy' - echo 'min_power' > '/sys/class/scsi_host/host3/link_power_management_policy' - echo 'min_power' > '/sys/class/scsi_host/host4/link_power_management_policy' - echo 'min_power' > '/sys/class/scsi_host/host5/link_power_management_policy' - /run/current-system/sw/bin/rmmod e1000e || true - ''; - # ${pkgs.ethtool}/bin/ethtool -s enp0s25 wol d || true - }; - services.xserver.videoDrivers = [ "intel" ]; }