diff options
Diffstat (limited to 'nixos/modules/system/boot/tmp.nix')
-rw-r--r-- | nixos/modules/system/boot/tmp.nix | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/tmp.nix b/nixos/modules/system/boot/tmp.nix index 5bb299adb15..6edafd6695b 100644 --- a/nixos/modules/system/boot/tmp.nix +++ b/nixos/modules/system/boot/tmp.nix @@ -2,6 +2,9 @@ with lib; +let + cfg = config.boot; +in { ###### interface @@ -24,18 +27,28 @@ with lib; ''; }; + boot.tmpOnTmpfsSize = mkOption { + type = types.oneOf [ types.str types.types.ints.positive ]; + default = "50%"; + description = '' + Size of tmpfs in percentage. + Percentage is defined by systemd. + ''; + }; + }; ###### implementation config = { - systemd.mounts = mkIf config.boot.tmpOnTmpfs [ + # When changing remember to update /tmp mount in virtualisation/qemu-vm.nix + systemd.mounts = mkIf cfg.tmpOnTmpfs [ { what = "tmpfs"; where = "/tmp"; type = "tmpfs"; - mountConfig.Options = [ "mode=1777" "strictatime" "rw" "nosuid" "nodev" "size=50%" ]; + mountConfig.Options = [ "mode=1777" "strictatime" "rw" "nosuid" "nodev" "size=${toString cfg.tmpOnTmpfsSize}" ]; } ]; |