From 5b63d1555a7d8fc212a1c2acf1314fd0afc1c436 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Wed, 31 Mar 2021 21:20:08 +0000 Subject: [PATCH] nixos/blade: use tmpfs for /var/log and /var/cache --- ops/nixos/lib/blade.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ops/nixos/lib/blade.nix b/ops/nixos/lib/blade.nix index f6273bf144..3ba3bd2bcc 100644 --- a/ops/nixos/lib/blade.nix +++ b/ops/nixos/lib/blade.nix @@ -48,6 +48,10 @@ in { device = device; fsType = "zfs"; }; + tmpfs = size: { + device = "none"; + fsType = "tmpfs"; + options = [ "defaults" "size=${size}" "mode=755" ]; in { "/" = zfs "tank/local/root"; "/tmp" = zfs "tank/local/tmp"; @@ -58,6 +62,8 @@ in { device = "/dev/disk/by-label/boot"; fsType = "ext4"; }; + "/var/log" = tmpfs "2G"; + "/var/cache" = tmpfs "16G"; } // (lib.optionalAttrs (config.services.ceph.osd.enable || config.services.ceph.mgr.enable || config.services.ceph.mon.enable || config.services.ceph.mgr.enable) { "/var/lib/ceph" = { device = "/dev/disk/by-label/var-lib-ceph";