mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 06:50:14 +01:00
21 lines
475 B
Nix
21 lines
475 B
Nix
{ pkgs, lib, ... }:
|
|
{
|
|
environment.systemPackages = with pkgs; [
|
|
hdparm
|
|
];
|
|
|
|
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 90 -S 41 /dev/%k"''
|
|
])
|
|
]);
|
|
}
|