7 (lib.mkRenamedOptionModule [ "boot" "cleanTmpDir" ] [ "boot" "tmp" "cleanOnBoot" ])
8 (lib.mkRenamedOptionModule [ "boot" "tmpOnTmpfs" ] [ "boot" "tmp" "useTmpfs" ])
9 (lib.mkRenamedOptionModule [ "boot" "tmpOnTmpfsSize" ] [ "boot" "tmp" "tmpfsSize" ])
14 cleanOnBoot = lib.mkOption {
15 type = lib.types.bool;
18 Whether to delete all files in {file}`/tmp` during boot.
22 tmpfsSize = lib.mkOption {
23 type = lib.types.oneOf [
25 lib.types.ints.positive
29 Size of tmpfs in percentage.
30 Percentage is defined by systemd.
34 useTmpfs = lib.mkOption {
35 type = lib.types.bool;
38 Whether to mount a tmpfs on {file}`/tmp` during boot.
41 Large Nix builds can fail if the mounted tmpfs is not large enough.
42 In such a case either increase the tmpfsSize or disable this option.
50 # When changing remember to update /tmp mount in virtualisation/qemu-vm.nix
51 systemd.mounts = lib.mkIf cfg.useTmpfs [
56 mountConfig.Options = lib.concatStringsSep "," [
62 "size=${toString cfg.tmpfsSize}"
67 systemd.tmpfiles.rules = lib.optional cfg.cleanOnBoot "D! /tmp 1777 root root";