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