nixcfg/nixosModules/system/zramSwap/default.nix

25 lines
478 B
Nix
Raw Normal View History

{
pkgs,
lib,
config,
...
}: {
options = {
2024-05-27 21:39:30 -04:00
alyraffauf.system.zramSwap = {
enable = lib.mkEnableOption "Enables zram swap.";
size = lib.mkOption {
description = "Percent size of the zram swap.";
default = 50;
type = lib.types.int;
};
};
};
config = lib.mkIf config.alyraffauf.system.zramSwap.enable {
zramSwap = {
enable = true;
memoryPercent = config.alyraffauf.system.zramSwap.size;
};
};
}