add(tmp): make /tmp an actual tmpfs
This commit is contained in:
parent
ddbe5c35c5
commit
5129239a24
4 changed files with 38 additions and 5 deletions
25
modules/nixos/system/tmp/default.nix
Normal file
25
modules/nixos/system/tmp/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue