mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
[Nix] Reduce auto-upgrade impact on system use
This commit is contained in:
parent
eb361ed428
commit
b9a160dd0a
1 changed files with 24 additions and 0 deletions
24
nix.nix
24
nix.nix
|
|
@ -16,6 +16,30 @@ in
|
|||
system.autoUpgrade.enable = mkDefault true;
|
||||
system.autoUpgrade.allowReboot = mkIf (!desktopCfg.enable) (mkDefault true);
|
||||
system.autoUpgrade.dates = "Sunday *-*-* 02:00";
|
||||
system.autoUpgrade.operation = "boot";
|
||||
system.autoUpgrade.persistent = true;
|
||||
system.autoUpgrade.rebootWindow = {
|
||||
lower = "01:00";
|
||||
upper = "05:00";
|
||||
};
|
||||
systemd.services.nixos-upgrade = {
|
||||
unitConfig = {
|
||||
ConditionCPUPressure = "user.slice:15%";
|
||||
ConditionMemoryPressure = "user.slice:50%";
|
||||
ConditionIOPressure = "user.slice:50%";
|
||||
};
|
||||
serviceConfig = {
|
||||
Nice = 19;
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
IOAccounting = true;
|
||||
IOWeight = 1024 / 10;
|
||||
CPUWeight = 1;
|
||||
CPUQuota = (toString (generalCfg.cores * 80)) + "%";
|
||||
Type = mkOverride 20 "simple";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
nix.gc.automatic = mkDefault true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue