7 cfg = config.powerManagement.scsiLinkPolicy;
9 kernel = config.boot.kernelPackages.kernel;
25 powerManagement.scsiLinkPolicy = mkOption {
27 type = types.nullOr (types.enum allowedValues);
29 SCSI link power management policy. The kernel default is
32 "med_power_with_dipm" is supported by kernel versions
42 config = mkIf (cfg != null) {
44 assertions = singleton {
45 assertion = (cfg == "med_power_with_dipm") -> versionAtLeast kernel.version "4.15";
46 message = "med_power_with_dipm is not supported for kernels older than 4.15";
49 services.udev.extraRules = ''
50 SUBSYSTEM=="scsi_host", ACTION=="add", KERNEL=="host*", ATTR{link_power_management_policy}="${cfg}"