From bd92cf4a2bfb047131126391999b9f01b87baea3 Mon Sep 17 00:00:00 2001 From: s-prechtl Date: Mon, 29 Sep 2025 11:14:07 +0200 Subject: [PATCH] feat: disk spindown eliminated --- hosts/saberofxebec/disk-spindown.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 hosts/saberofxebec/disk-spindown.nix diff --git a/hosts/saberofxebec/disk-spindown.nix b/hosts/saberofxebec/disk-spindown.nix new file mode 100644 index 0000000..b114638 --- /dev/null +++ b/hosts/saberofxebec/disk-spindown.nix @@ -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"'' + ])]); +}