blob: f5ba2a9a463d10dcfea9b93329a21568f0e0a0aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
{ config, lib, ... }:
let
cfg = config.traits.zram;
in
{
options.traits.zram = {
enable = lib.mkEnableOption "zram and sysctl optimizations";
};
config = lib.mkIf cfg.enable {
# https://github.com/pop-os/default-settings/pull/163
# https://wiki.archlinux.org/title/Zram#Multiple_zram_devices
boot.kernel.sysctl = {
"vm.swappiness" = 180;
"vm.watermark_boost_factor" = 0;
"vm.watermark_scale_factor" = 125;
"vm.page-cluster" = 0;
};
zramSwap.enable = true;
};
}
|