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 = {
enable = true;
flake = "/home/coolneng/system";
flags = [
"--update-input"
"agenix"
"--update-input"
"nixpkgs"
"--commit-lock-file"
];
flags =
[ "--update-input agenix --update-input nixpkgs" "--commit-lock-file" ];
};
# Limit the memory and CPU use of Nix
systemd.services.nixos-upgrade.serviceConfig = {
MemoryHigh = [ "500M" ];
MemoryMax = [ "2048M" ];
CPUWeight = [ "20" ];
CPUQuota = [ "85%" ];
IOWeight = [ "20" ];
};
# Configure git for auto-upgrade