9 options.hardware.usbStorage.manageShutdown = lib.mkOption {
10 type = lib.types.bool;
13 Enable this option to gracefully spin-down external storage during shutdown.
14 If you suspect improper head parking after poweroff, install `smartmontools` and check
15 for the `Power-Off_Retract_Count` field for an increment.
19 config = lib.mkIf config.hardware.usbStorage.manageShutdown {
20 services.udev.extraRules = ''
21 ACTION=="add|change", SUBSYSTEM=="scsi_disk", DRIVERS=="usb-storage|uas", ATTR{manage_shutdown}="1"
26 (lib.mkRenamedOptionModule
27 [ "hardware" "usbStorage" "manageStartStop" ]
28 [ "hardware" "usbStorage" "manageShutdown" ]