From e83b5379536f21dddc1c724a72ad60363641e865 Mon Sep 17 00:00:00 2001 From: Elec3137 Date: Tue, 3 Mar 2026 13:59:11 -0800 Subject: [PATCH] system: add tmpfs mountpoint "/home/tmp" --- system/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/system/default.nix b/system/default.nix index ee003b7..a094fd8 100644 --- a/system/default.nix +++ b/system/default.nix @@ -60,10 +60,20 @@ in # consider disabling if you have very limited memory boot.tmp = lib.mkDefault { useTmpfs = true; - tmpfsSize = "70%"; tmpfsHugeMemoryPages = "within_size"; }; + fileSystems."/home/tmp" = lib.mkDefault { + fsType = "tmpfs"; + + # inherit options created by boot.tmp.useTmpfs if avaliable + options = + let + tmpMount = lib.findFirst (mount: mount.where == "/tmp") null config.systemd.mounts; + in + lib.mkIf (tmpMount != null) (lib.splitStringBy (p: c: c == ",") false tmpMount.mountConfig.Options); + }; + # run fstrim monthly instead of weekly # weekly is unecessary for preventing long-term performance degredation # https://unix.stackexchange.com/questions/218076/ssd-how-often-should-i-do-fstrim