From dd01dc72a8f495f8880ec936cd3e00a13cb3f8a1 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 17 Oct 2020 09:58:44 +0200 Subject: [PATCH] restic: Set nice and ionice --- modules/restic.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/restic.nix b/modules/restic.nix index d13f0cf..a08c0f7 100644 --- a/modules/restic.nix +++ b/modules/restic.nix @@ -1,5 +1,6 @@ { pkgs, config, lib, ... }: let + name = "${config.networking.hostName}-system"; excludes = [ # General "/home/*/Downloads/" @@ -41,7 +42,7 @@ let maybePath = path: (lib.optional (builtins.pathExists path) (toString path)); in { - services.restic.backups."${config.networking.hostName}-system" = { + services.restic.backups."${name}" = { passwordFile = toString (../secrets/restic_password); s3CredentialsFile = toString ../secrets/s3_credentials; repository = "s3:https://s3.eu-central-1.wasabisys.com/sbruder-restic"; @@ -63,4 +64,10 @@ in RandomizedDelaySec = "2h"; }; }; + + systemd.services."restic-backups-${name}".serviceConfig = { + "Nice" = 10; + "IOSchedulingClass" = "best-effort"; + "IOSchedulingPriority" = 7; + }; }