From c43cd8b595b12cb883097a292dd95cf79bd882c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sun, 18 Jan 2026 00:08:19 +0100 Subject: [PATCH] vanadium: update {min,max}-free with a formula --- nix/configurations/vanadium/nixos/sane-nix.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nix/configurations/vanadium/nixos/sane-nix.nix b/nix/configurations/vanadium/nixos/sane-nix.nix index 83c080d8..bb710e8e 100644 --- a/nix/configurations/vanadium/nixos/sane-nix.nix +++ b/nix/configurations/vanadium/nixos/sane-nix.nix @@ -1,8 +1,11 @@ # Protect my system from running out of storage or memory +let + totalStorage = 930; +in { nix.settings = { - min-free = 50 * 1024 * 1024 * 1024; - max-free = 100 * 1024 * 1024 * 1024; + 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 = {