powerManagement.enable sets link_power_management_policy to min_power
svn path=/nixos/trunk/; revision=31490
This commit is contained in:
parent
036e585b42
commit
f169f60575
@ -92,7 +92,7 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = "ondemand";
|
powerManagement.cpuFreqGovernor = "ondemand";
|
||||||
|
powerManagement.scsiLinkPolicy = "min_power";
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -195,6 +195,7 @@
|
|||||||
./tasks/kbd.nix
|
./tasks/kbd.nix
|
||||||
./tasks/lvm.nix
|
./tasks/lvm.nix
|
||||||
./tasks/network-interfaces.nix
|
./tasks/network-interfaces.nix
|
||||||
|
./tasks/scsi-link-power-management.nix
|
||||||
./tasks/swraid.nix
|
./tasks/swraid.nix
|
||||||
./tasks/tty-backgrounds.nix
|
./tasks/tty-backgrounds.nix
|
||||||
./virtualisation/libvirtd.nix
|
./virtualisation/libvirtd.nix
|
||||||
|
44
modules/tasks/scsi-link-power-management.nix
Normal file
44
modules/tasks/scsi-link-power-management.nix
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs.lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
powerManagement.scsiLinkPolicy = mkOption {
|
||||||
|
default = "";
|
||||||
|
example = "min_power";
|
||||||
|
description = ''
|
||||||
|
Configure the scsi link power management policy. By default,
|
||||||
|
the kernel configures "max_performance".
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
config = mkIf (config.powerManagement.scsiLinkPolicy != "") {
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.cpufrequtils ];
|
||||||
|
|
||||||
|
jobs.cpufreq =
|
||||||
|
{ description = "Set SCSI link power management policy";
|
||||||
|
|
||||||
|
startOn = "started udev";
|
||||||
|
|
||||||
|
task = true;
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
for x in /sys/class/scsi_host/host*/link_power_management_policy; do
|
||||||
|
echo ${config.powerManagement.scsiLinkPolicy} > $x
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user