summary refs log tree commit diff
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2020-12-23 22:44:20 +0100
committerJanne Heß <janne@hess.ooo>2020-12-26 13:13:41 +0100
commit56d7e7492cbf2d61bd570f5b0a8015040e80aae9 (patch)
tree46c2f259094b944abc7737a8d4e5db9468d2e971
parentdb9a28338f4bfa0c571881eec4745bae2708b42f (diff)
downloadnixpkgs-56d7e7492cbf2d61bd570f5b0a8015040e80aae9.tar
nixpkgs-56d7e7492cbf2d61bd570f5b0a8015040e80aae9.tar.gz
nixpkgs-56d7e7492cbf2d61bd570f5b0a8015040e80aae9.tar.bz2
nixpkgs-56d7e7492cbf2d61bd570f5b0a8015040e80aae9.tar.lz
nixpkgs-56d7e7492cbf2d61bd570f5b0a8015040e80aae9.tar.xz
nixpkgs-56d7e7492cbf2d61bd570f5b0a8015040e80aae9.tar.zst
nixpkgs-56d7e7492cbf2d61bd570f5b0a8015040e80aae9.zip
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.
-rw-r--r--nixos/modules/system/boot/tmp.nix8
1 files changed, 7 insertions, 1 deletions
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";