Unverified Commit c960ba48 authored by Parker Hoyes's avatar Parker Hoyes Committed by GitHub
Browse files

nixos/nix-daemon: Enable cgroups delegation (#339310)

When `use-cgroups` is enabled, the nix daemon creates sub-cgroups for the build processes (and itself if NixOS/nix#11412 is merged, see NixOS/nix#9675). `Delegate` should be set to prevent systemd from messing with the nix service's cgroups (https://github.com/systemd/systemd/blob/main/docs/CGROUP_DELEGATION.md) and ensure the OOM killer only targets the offending derivation and not the entire service (NixOS/nix#10374).
parent 7f23fcdf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -198,6 +198,7 @@ in
            IOSchedulingClass = cfg.daemonIOSchedClass;
            IOSchedulingPriority = cfg.daemonIOSchedPriority;
            LimitNOFILE = 1048576;
            Delegate = "yes";
          };

        restartTriggers = [ config.environment.etc."nix/nix.conf".source ];