monolith: run nix builds in tmpfs, improve zram performance
This commit is contained in:
parent
8abfa4dd40
commit
1685f9b472
1 changed files with 19 additions and 0 deletions
|
|
@ -161,6 +161,25 @@ in
|
|||
useTmpfs = true;
|
||||
};
|
||||
|
||||
fileSystems."/nix/var/nix/builds" = {
|
||||
device = "tmpfs";
|
||||
fsType = "tmpfs";
|
||||
options = [
|
||||
"size=20G" # adjust for your situation and needs
|
||||
"mode=700"
|
||||
];
|
||||
};
|
||||
|
||||
zramSwap.enable = true;
|
||||
zramSwap.memoryPercent = 100;
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
"vm.swappiness" = 180;
|
||||
"vm.watermark_boost_factor" = 0;
|
||||
"vm.watermark_scale_factor" = 125;
|
||||
"vm.page-cluster" = 0;
|
||||
};
|
||||
|
||||
# swap
|
||||
# fileSystems."/swap" = {
|
||||
# device = "/dev/disk/by-label/BTRFS_ROOT";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue