From 373e75389884bf01d974ca1fb8cd4f9656af458a Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Wed, 12 Apr 2023 00:43:55 +0200 Subject: [PATCH] [Filesystems] Set /tmp size to 150% of RAM if swap is active, and 75% otherwise --- filesystems.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/filesystems.nix b/filesystems.nix index 7473286..34cb87f 100644 --- a/filesystems.nix +++ b/filesystems.nix @@ -119,6 +119,12 @@ in }; boot.tmpOnTmpfs = true; + boot.tmpOnTmpfsSize = + let + hasSwap = length config.swapDevices > 0; + in + if hasSwap then "150%" else "75%" + ; services.smartd = { enable = mkDefault true;