.files/nix/configurations/hetzner_benchmark/nixos/sane-nix.nix

16 lines
391 B
Nix

# Protect my system from running out of storage or memory
let
totalStorage = 500;
in
{
nix.settings = {
min-free = builtins.ceil (totalStorage * 0.2) * 1024 * 1024 * 1024;
max-free = builtins.ceil (totalStorage * 0.3) * 1024 * 1024 * 1024;
};
systemd.services.nix-daemon.serviceConfig = {
MemoryAccounting = true;
MemoryMax = "90%";
OOMScoreAdjust = 500;
};
}