From 317e43e9a055f46c9f49c8e36c3839e5d4c8132f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Mon, 5 Jan 2026 08:44:23 +0100 Subject: [PATCH] hetzner_benchmark/sane-nix: init storage and memory protection --- .../hetzner_benchmark/nixos/sane-nix.nix | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 nix/configurations/hetzner_benchmark/nixos/sane-nix.nix 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; + }; +}