forked from raito/shared-public-infra
nix-daemon: improve open files for NixOS VM tests and thundering effects for GC
This commit is contained in:
parent
7fd10c28cb
commit
5e9b7b7732
|
@ -24,11 +24,19 @@ in
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
warnings = lib.optionals (config.simd.arch == null) [ "Please set simd.arch for ${config.networking.hostName}" ];
|
warnings = lib.optionals (config.simd.arch == null) [ "Please set simd.arch for ${config.networking.hostName}" ];
|
||||||
|
# Allow more open files for non-root users to run NixOS VM tests.
|
||||||
|
security.pam.loginLimits = [
|
||||||
|
{ domain = "*"; item = "nofile"; type = "-"; value = "20480"; }
|
||||||
|
];
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
|
# Garbage-collect often
|
||||||
gc.automatic = true;
|
gc.automatic = true;
|
||||||
gc.dates = "03:15";
|
gc.dates = "*:45";
|
||||||
gc.options = "--delete-older-than 30d";
|
gc.options = ''--max-freed "$((128 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | ${pkgs.gawk}/bin/awk '{ print $4 }')))"'';
|
||||||
|
|
||||||
|
# Randomize GC to avoid thundering herd effects.
|
||||||
|
gc.randomizedDelaySec = "1800";
|
||||||
|
|
||||||
# 2.11, 2.12 suffers from a bug with remote builders…
|
# 2.11, 2.12 suffers from a bug with remote builders…
|
||||||
package = pkgs.nixVersions.nix_2_13;
|
package = pkgs.nixVersions.nix_2_13;
|
||||||
|
|
Loading…
Reference in a new issue