stargate powersavings
This commit is contained in:
parent
c26057cb97
commit
750689b0f6
1 changed files with 24 additions and 0 deletions
24
systems/x86_64-linux/stargate/powersave.nix
Normal file
24
systems/x86_64-linux/stargate/powersave.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
powerManagement.powertop.enable = true;
|
||||
environment.systemPackages = with pkgs; [
|
||||
powertop
|
||||
];
|
||||
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 ${builtins.toString (30 * 60 / 5)} /dev/%k"''
|
||||
])
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue