1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2025-01-01 18:03:54 +00:00
ultima/modules/nixos/services/zram/default.nix

29 lines
369 B
Nix

{
x,
lib,
config,
...
}:
with lib;
with x;
let
cfg = config.module.services.zram;
in
{
options = {
module.services.zram = {
enable = mkBool;
algo = mkOpt.str;
};
};
config = mkIf cfg.enable {
zramSwap = True // {
priority = 1000;
algorithm = cfg.algo;
swapDevices = 1;
memoryPercent = 100;
};
};
}