diff --git a/nix/configurations/hetzner_benchmark/nixos/sane-nix.nix b/nix/configurations/hetzner_benchmark/nixos/sane-nix.nix new file mode 100644 index 00000000..dc4e2f13 --- /dev/null +++ b/nix/configurations/hetzner_benchmark/nixos/sane-nix.nix @@ -0,0 +1,21 @@ +# Protect my system from running out of storage or memory +{ + # 500GB Storage + nix.settings = { + min-free = 20 * 1024 * 1024 * 1024; + max-free = 50 * 1024 * 1024 * 1024; + }; + + systemd.services.nix-daemon.serviceConfig = { + MemoryAccounting = true; + MemoryMax = "90%"; + OOMScoreAdjust = 500; + }; + + # 12 Cores, 64 GB RAM + # split into 4 jobs with 3C/16G + nix.settings = { + cores = 3; + max-jobs = 4; + }; +}