From d5fa73ee65eb8ad7a90cdec8afe430078f87b3c5 Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Sat, 4 Feb 2023 23:07:58 +0100 Subject: [PATCH] [Nix] Reduce daemon impact on running system --- nix.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/nix.nix b/nix.nix index aeca47e..5b67a30 100644 --- a/nix.nix +++ b/nix.nix @@ -25,9 +25,15 @@ in nix.optimise.dates = mkDefault [ "Tuesday,Thursday,Saturday 03:00:00" ]; nix.settings.auto-optimise-store = mkDefault true; - nix.daemonIOSchedPriority = 7; - nix.daemonCPUSchedPolicy = "batch"; - nix.daemonIOSchedClass = "idle"; + systemd.services.nix-daemon = { + serviceConfig = { + Nice = 19; + CPUSchedulingPolicy = mkForce "batch"; + IOSchedulingClass = mkForce "idle"; + IOAccounting = true; + IOWeight = 1024 / 10; + }; + }; nix.package = mkIf (strings.versionOlder pkgs.nix.version "2.7") pkgs.nix_2_7;