[Nix] use CGroups and always allow substitutes

We are almost always better downloading everything considering our
network speed.
This commit is contained in:
Antoine Viallon 2024-05-23 11:02:22 +02:00
parent 66c0c21178
commit 7a79e4234c
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -112,6 +112,9 @@ in
++ optional cfg.contentAddressed "cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA="
);
nix.settings.use-cgroups = true;
nix.settings.always-allow-substitutes = true;
nix.settings.cores = mkIf (generalCfg.cpu.threads != null) generalCfg.cpu.threads;
nix.settings.max-jobs = mkIf (generalCfg.cpu.threads != null) (math.log2 generalCfg.cpu.threads);