mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-24 23:11:55 -05:00
19 lines
451 B
Nix
19 lines
451 B
Nix
{ 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 = {
|
|
enable = true;
|
|
memoryPercent = config.systemConfig.zramSwap.size;
|
|
};
|
|
};
|
|
}
|