2024-04-07 22:16:33 -04:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: {
|
2024-03-28 16:13:46 -04:00
|
|
|
options = {
|
|
|
|
systemConfig.zramSwap.enable = lib.mkEnableOption "Enables zram swap.";
|
2024-03-30 21:14:13 -04:00
|
|
|
systemConfig.zramSwap.size = lib.mkOption {
|
|
|
|
description = "Percent size of the zram swap.";
|
|
|
|
default = 50;
|
|
|
|
type = lib.types.int;
|
|
|
|
};
|
2024-03-28 16:13:46 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf config.systemConfig.zramSwap.enable {
|
|
|
|
zramSwap = {
|
2024-03-28 16:40:23 -04:00
|
|
|
enable = true;
|
2024-03-30 21:14:13 -04:00
|
|
|
memoryPercent = config.systemConfig.zramSwap.size;
|
2024-03-28 16:13:46 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|