22 lines
421 B
Nix
Raw Normal View History

2025-07-05 00:02:39 +02:00
{
lib,
config,
...
}:
with lib; let
2025-08-15 21:33:22 +02:00
cfg = config.mySystem.boot.zram;
2025-07-05 00:02:39 +02:00
in {
2025-08-15 21:33:22 +02:00
options.mySystem.boot.zram = {
2025-07-05 00:02:39 +02:00
enable = mkEnableOption "Enable ZRAM";
memoryMax = mkOption {
type = types.int;
example = "512";
description = "Maximum size allocated to ZRAM in MiB";
};
};
config.zramSwap = mkIf cfg.enable {
inherit (cfg) enable;
memoryMax = cfg.memoryMax * 1024 * 1024;
};
}