Limit resource usage when performing upgrades

This commit is contained in:
coolneng 2024-03-25 13:41:31 +01:00
parent bd493ea8ea
commit 255cb34846
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 11 additions and 7 deletions

View File

@ -180,13 +180,17 @@ with pkgs;
system.autoUpgrade = { system.autoUpgrade = {
enable = true; enable = true;
flake = "/home/coolneng/system"; flake = "/home/coolneng/system";
flags = [ flags =
"--update-input" [ "--update-input agenix --update-input nixpkgs" "--commit-lock-file" ];
"agenix" };
"--update-input"
"nixpkgs" # Limit the memory and CPU use of Nix
"--commit-lock-file" systemd.services.nixos-upgrade.serviceConfig = {
]; MemoryHigh = [ "500M" ];
MemoryMax = [ "2048M" ];
CPUWeight = [ "20" ];
CPUQuota = [ "85%" ];
IOWeight = [ "20" ];
}; };
# Configure git for auto-upgrade # Configure git for auto-upgrade