feat: disk spindown eliminated
This commit is contained in:
parent
6d60a45e44
commit
bd92cf4a2b
1 changed files with 14 additions and 0 deletions
14
hosts/saberofxebec/disk-spindown.nix
Normal file
14
hosts/saberofxebec/disk-spindown.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{lib, pkgs, ...}: {
|
||||||
|
# Disables spindown on all disks of /dev/sd* format. -S might be used later not sure if needed yet.
|
||||||
|
services.udev.extraRules =
|
||||||
|
let
|
||||||
|
mkRule = as: lib.concatStringsSep ", " as;
|
||||||
|
mkRules = rs: lib.concatStringsSep "\n" rs;
|
||||||
|
in mkRules ([( mkRule [
|
||||||
|
''ACTION=="add|change"''
|
||||||
|
''SUBSYSTEM=="block"''
|
||||||
|
''KERNEL=="sd[a-z]"''
|
||||||
|
''ATTR{queue/rotational}=="1"''
|
||||||
|
''RUN+="${pkgs.hdparm}/bin/hdparm -B 254 /dev/%k"''
|
||||||
|
])]);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue