mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 17:43:55 -05:00
25 lines
478 B
Nix
25 lines
478 B
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}: {
|
|
options = {
|
|
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;
|
|
};
|
|
};
|
|
}
|