From 56d7e7492cbf2d61bd570f5b0a8015040e80aae9 Mon Sep 17 00:00:00 2001 From: Janne Heß Date: Wed, 23 Dec 2020 22:44:20 +0100 Subject: nixos/tmp: Make /tmp on ramdisk usable again @poettering decided we only need a limited number of inodes in our /tmp, so why not limit that for every systemd user? That makes medium-sized nix builds impossible so this commit restores the old behaviour which is the kernel default of half the number of physical RAM pages which does not seem too unreasonable to me. --- nixos/modules/system/boot/tmp.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/tmp.nix b/nixos/modules/system/boot/tmp.nix index 26eb172210e..837e308cbea 100644 --- a/nixos/modules/system/boot/tmp.nix +++ b/nixos/modules/system/boot/tmp.nix @@ -30,7 +30,13 @@ with lib; config = { - systemd.additionalUpstreamSystemUnits = optional config.boot.tmpOnTmpfs "tmp.mount"; + systemd.mounts = mkIf config.boot.tmpOnTmpfs [ + { + what = "tmpfs"; + where = "/tmp"; + mountConfig.Options = [ "mode=1777" "strictatime" "rw" "nosuid" "nodev" "size=50%" ]; + } + ]; systemd.tmpfiles.rules = optional config.boot.cleanTmpDir "D! /tmp 1777 root root"; -- cgit 1.4.1