diff --git a/configuration.nix b/configuration.nix index 2d9b4a6..5a0b3af 100644 --- a/configuration.nix +++ b/configuration.nix @@ -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 + ]; } diff --git a/modules/periodic.nix b/modules/periodic.nix new file mode 100644 index 0000000..8348a34 --- /dev/null +++ b/modules/periodic.nix @@ -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" ]; + }; +}