1
0
Fork 0
nix-config/modules/nixos/system/tmp/default.nix

25 lines
388 B
Nix

{
config,
lib,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.system.tmpfs;
in
{
options.${namespace}.system.tmpfs = with types; {
enable = mkBoolOpt false "Whether or not to use tmpfs for /tmp.";
};
config = mkIf cfg.enable {
boot.tmp = {
cleanOnBoot = true;
tmpfsSize = "50%";
useTmpfs = true;
};
};
}