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

29 lines
369 B
Nix
Raw Normal View History

{
x,
lib,
config,
...
}:
2024-11-21 09:24:15 +00:00
with lib;
2024-12-09 01:15:55 +00:00
with x;
let
cfg = config.module.services.zram;
in
{
2024-11-21 09:24:15 +00:00
options = {
module.services.zram = {
2024-12-09 01:15:55 +00:00
enable = mkBool;
algo = mkOpt.str;
2024-11-21 09:24:15 +00:00
};
};
config = mkIf cfg.enable {
zramSwap = True // {
priority = 1000;
algorithm = cfg.algo;
swapDevices = 1;
memoryPercent = 100;
};
};
}