fix(nixos): gate zram kernel sysctl tunings behind modules.zram.enable

The zram module was auto-imported on all hosts via base scanPaths, and its
swappiness=180/page-cluster=0 tunings leaked onto hosts that disabled zram
(e.g. idols-ai with a disk swapfile, pushing cold anon pages to disk swap).
Wrap the whole module in modules.zram.enable (default true); idols-ai now
turns off zram and its tunings with a single switch.
This commit is contained in:
Ryan Yin
2026-08-29 11:16:12 +08:00
parent 33ca0819df
commit 4b7375c077
2 changed files with 63 additions and 38 deletions
+2 -1
View File
@@ -39,7 +39,8 @@ in
];
# Zram consumes physical memory for compression, which can cause a deadlock and system hang if the model size approaches the physical memory limit.
zramSwap.enable = lib.mkForce false;
# Disable the whole module (zram device + its swappiness=180 sysctl tunings); this host uses a disk swapfile instead.
modules.zram.enable = false;
services.sunshine.enable = false;
services.tuned.ppdSettings.main.default = lib.mkForce "performance";