1 { config, lib, pkgs, ... }:
5 options.hardware.usbStorage.manageStartStop = mkOption {
8 description = lib.mdDoc ''
9 Enable this option to gracefully spin-down external storage during shutdown.
10 If you suspect improper head parking after poweroff, install `smartmontools` and check
11 for the `Power-Off_Retract_Count` field for an increment.
15 config = mkIf config.hardware.usbStorage.manageStartStop {
16 services.udev.extraRules = ''
17 ACTION=="add|change", SUBSYSTEM=="scsi_disk", DRIVERS=="usb-storage", ATTR{manage_start_stop}="1"