feat(restic): limit resource usage
This commit is contained in:
parent
436ba2719f
commit
b57b2293ca
19
modules/restic.nix
Normal file
19
modules/restic.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
systemd.services = mapAttrs' (name: backup:
|
||||||
|
nameValuePair "restic-backups-${name}" ({
|
||||||
|
serviceConfig = {
|
||||||
|
CPUWeight = 25;
|
||||||
|
MemoryHigh = "50%";
|
||||||
|
MemoryMax = "75%";
|
||||||
|
IOWeight = 50;
|
||||||
|
IOSchedulingClass = "idle";
|
||||||
|
IOSchedulingPriority = 7;
|
||||||
|
};
|
||||||
|
})) config.services.restic.backups;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,8 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
imports = [ ../../modules/restic.nix ];
|
||||||
|
|
||||||
age.secrets.restic-b2.file = ../../secrets/restic/b2.age;
|
age.secrets.restic-b2.file = ../../secrets/restic/b2.age;
|
||||||
age.secrets.restic-password.file = ../../secrets/restic/password.age;
|
age.secrets.restic-password.file = ../../secrets/restic/password.age;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue