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 [ lib.types.str lib.types.ints.positive ];
26 Size of tmpfs in percentage.
27 Percentage is defined by systemd.
31 useTmpfs = lib.mkOption {
32 type = lib.types.bool;
35 Whether to mount a tmpfs on {file}`/tmp` during boot.
38 Large Nix builds can fail if the mounted tmpfs is not large enough.
39 In such a case either increase the tmpfsSize or disable this option.
47 # When changing remember to update /tmp mount in virtualisation/qemu-vm.nix
48 systemd.mounts = lib.mkIf cfg.useTmpfs [
53 mountConfig.Options = lib.concatStringsSep "," [
59 "size=${toString cfg.tmpfsSize}"
64 systemd.tmpfiles.rules = lib.optional cfg.cleanOnBoot "D! /tmp 1777 root root";