feat: add smart alerting and noatime to disks
This commit is contained in:
19
hosts/nas/modules/power-management.nix
Normal file
19
hosts/nas/modules/power-management.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
# Power management for NAS
|
||||
# - CPU powersave governor (scales up on demand for transcoding)
|
||||
# - Disk spindown after 15 minutes idle
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# CPU Power Management - powersave scales up on demand for transcoding
|
||||
powerManagement.cpuFreqGovernor = "powersave";
|
||||
|
||||
# Disk spindown - hdparm for Seagate 18TB drives
|
||||
environment.systemPackages = [ pkgs.hdparm ];
|
||||
|
||||
services.udev.extraRules = ''
|
||||
# Seagate 18TB NAS drives - APM 127 allows spindown, -S 180 = 15 min
|
||||
ACTION=="add", KERNEL=="sd[a-z]", SUBSYSTEM=="block", \
|
||||
ATTRS{model}=="ST18000NM000J*", \
|
||||
RUN+="${pkgs.hdparm}/bin/hdparm -B 127 -S 180 /dev/%k"
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user