monolith: run nix builds in tmpfs, improve zram performance

This commit is contained in:
Leonardo Eugênio 2026-04-16 21:27:21 -03:00
parent 8abfa4dd40
commit 1685f9b472

View file

@ -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";