restic: Set nice and ionice

This commit is contained in:
Simon Bruder 2020-10-17 09:58:44 +02:00
parent 5838b757f4
commit dd01dc72a8
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F

View file

@ -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;
};
}