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`.
This commit is contained in:
Yegor Timoshenko 2017-12-24 01:22:48 +00:00
parent fcb9d76ead
commit 7810833d2d
No known key found for this signature in database
GPG key ID: C34BF9DCC9DF8210

View file

@ -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" ];
}