Add disk shutdown for backup

This commit is contained in:
Fabian Hauser 2020-03-01 00:54:15 +00:00
parent 746680731e
commit bebb3da27a

View file

@ -29,6 +29,11 @@
swapDevices = [{ device = "/dev/mapper/swap"; }];
# Get disk identifier with `udevadm info -n /dev/sdX | grep ID_SERIAL_SHORT`
services.udev.extraRules = ''
ACTION=="add", KERNEL=="sd[a-z]", ENV{ID_SERIAL_SHORT}=="WD-WXH1A89L54LA", RUN+="${pkgs.hdparm}/bin/hdparm -S 60 /dev/%k"
'';
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;