Spin down the HDDs when not in use

This commit is contained in:
coolneng 2021-05-26 11:53:07 +02:00
parent 76c49857db
commit 87f35f3bb3
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 18 additions and 1 deletions

View File

@ -97,6 +97,10 @@
services.journald.extraConfig = "SystemMaxFiles=7";
# Import other configuration modules
imports = [ ./modules/hardware-configuration.nix ./modules/networking.nix ];
imports = [
./modules/hardware-configuration.nix
./modules/networking.nix
./modules/periodic.nix
];
}

13
modules/periodic.nix Normal file
View File

@ -0,0 +1,13 @@
{ config, lib, pkgs, ... }:
{
# Idle HDDs when not used
systemd.services.hd-idle = {
description = "Idle HDDs when not in use";
wantedBy = [ "default.target" ];
path = with pkgs; [ hd-idle ];
script = "${pkgs.hd-idle}/bin/hd-idle";
serviceConfig.Type = "simple";
after = [ "shield-unit.mount" ];
};
}