22 lines
361 B
Nix
22 lines
361 B
Nix
{ lib, config, ... }:
|
|
let
|
|
cfg = device.zram;
|
|
in
|
|
{
|
|
options = {
|
|
device.zram = {
|
|
enable = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
description = "Zram settings for the device.";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
zramSwap = {
|
|
enable = true;
|
|
memoryPercent = 100;
|
|
};
|
|
};
|
|
}
|