{ config, pkgs, ... }: { nix = { buildCores = 0; daemonCPUSchedPolicy = "idle"; daemonIOSchedClass = "idle"; trustedUsers = [ "@wheel" ]; package = pkgs.nixFlakes; extraOptions = '' keep-outputs = true keep-derivations = true experimental-features = nix-command flakes ''; autoOptimiseStore = true; gc = { automatic = true; options = "--delete-older-than 14d"; }; }; system.autoUpgrade = { enable = true; flags = [ "--max-jobs" "2" ]; }; systemd.services.nixos-upgrade = { script = pkgs.lib.mkForce '' ${pkgs.nix}/bin/nix-channel --update ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot --no-build-output ${toString config.system.autoUpgrade.flags} ''; }; }