system: add tmpfs mountpoint "/home/tmp"
This commit is contained in:
parent
fed2b4f064
commit
e83b537953
1 changed files with 11 additions and 1 deletions
|
|
@ -60,10 +60,20 @@ in
|
||||||
# consider disabling if you have very limited memory
|
# consider disabling if you have very limited memory
|
||||||
boot.tmp = lib.mkDefault {
|
boot.tmp = lib.mkDefault {
|
||||||
useTmpfs = true;
|
useTmpfs = true;
|
||||||
tmpfsSize = "70%";
|
|
||||||
tmpfsHugeMemoryPages = "within_size";
|
tmpfsHugeMemoryPages = "within_size";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fileSystems."/home/tmp" = lib.mkDefault {
|
||||||
|
fsType = "tmpfs";
|
||||||
|
|
||||||
|
# inherit options created by boot.tmp.useTmpfs if avaliable
|
||||||
|
options =
|
||||||
|
let
|
||||||
|
tmpMount = lib.findFirst (mount: mount.where == "/tmp") null config.systemd.mounts;
|
||||||
|
in
|
||||||
|
lib.mkIf (tmpMount != null) (lib.splitStringBy (p: c: c == ",") false tmpMount.mountConfig.Options);
|
||||||
|
};
|
||||||
|
|
||||||
# run fstrim monthly instead of weekly
|
# run fstrim monthly instead of weekly
|
||||||
# weekly is unecessary for preventing long-term performance degredation
|
# weekly is unecessary for preventing long-term performance degredation
|
||||||
# https://unix.stackexchange.com/questions/218076/ssd-how-often-should-i-do-fstrim
|
# https://unix.stackexchange.com/questions/218076/ssd-how-often-should-i-do-fstrim
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue