From 5911e6f6785b54b2565cb7380bbf32498d379ec0 Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 24 May 2021 21:44:00 +0200 Subject: [PATCH] Spin down the HDDs when not in use --- modules/periodic.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/periodic.nix b/modules/periodic.nix index 2305eca..0ff5b51 100644 --- a/modules/periodic.nix +++ b/modules/periodic.nix @@ -61,4 +61,15 @@ in { requires = [ "sata-hat.service" ]; after = [ "vault.mount" ]; }; + + # 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"; + requires = [ "sata-hat.service" ]; + after = [ "vault.mount" ]; + }; }