mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-20 04:33:57 +00:00
cc41bce79d
should be "uniq" by default. svn path=/nixos/trunk/; revision=31520
44 lines
836 B
Nix
44 lines
836 B
Nix
{ config, pkgs, ... }:
|
|
|
|
with pkgs.lib;
|
|
|
|
{
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
powerManagement.scsiLinkPolicy = mkOption {
|
|
default = "";
|
|
example = "min_power";
|
|
type = types.uniq types.string;
|
|
description = ''
|
|
Configure the scsi link power management policy. By default,
|
|
the kernel configures "max_performance".
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf (config.powerManagement.scsiLinkPolicy != "") {
|
|
|
|
jobs.scsilinkpmpolicy =
|
|
{ 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
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
}
|