25 lines
408 B
Nix
25 lines
408 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
cfg = config.weinturm.zram;
|
|
in {
|
|
options.weinturm = with lib; {
|
|
zram = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = true;
|
|
description = "Whether to enable zram swap";
|
|
};
|
|
};
|
|
};
|
|
config = {
|
|
zramSwap = {
|
|
inherit (cfg) enable;
|
|
algorithm = "zstd";
|
|
memoryPercent = 60;
|
|
priority = 1;
|
|
};
|
|
};
|
|
}
|