1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2025-01-08 21:13:52 +00:00
ultima/modules/nixos/services/zram/default.nix
2024-11-21 18:24:15 +09:00

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;
};
};
}