nixcfg/nixosModules/systemConfig/zramSwap/default.nix

23 lines
458 B
Nix
Raw Normal View History

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