mirror of
https://git.sr.ht/~neverness/ultima
synced 2025-01-08 18:53:53 +00:00
27 lines
427 B
Nix
27 lines
427 B
Nix
{ lib, config, True, ... }:
|
|
|
|
with lib;
|
|
|
|
let cfg = config.module.services.zram;
|
|
in {
|
|
options = {
|
|
module.services.zram = {
|
|
enable = mkEnableOption "";
|
|
algo = mkOption {
|
|
type = types.str;
|
|
default = null;
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
zramSwap = True // {
|
|
priority = 1000;
|
|
algorithm = cfg.algo;
|
|
swapDevices = 1;
|
|
memoryPercent = 100;
|
|
};
|
|
};
|
|
}
|
|
|