diff --git a/configuration.nix b/configuration.nix index 868a4fa..f5e39e1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -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