add (device options): add zram and laptop config options

This commit is contained in:
Kirill Samoylenkov 2025-09-26 23:28:31 +05:00
parent 83c8ef2a42
commit cb33cd4006
4 changed files with 146 additions and 0 deletions

22
options/device/zram.nix Normal file
View file

@ -0,0 +1,22 @@
{ lib, config, ... }:
let
cfg = device.zram;
in
{
options = {
device.zram = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Zram settings for the device.";
};
};
};
config = lib.mkIf cfg.enable {
zramSwap = {
enable = true;
memoryPercent = 100;
};
};
}