add (device options): add zram and laptop config options
This commit is contained in:
parent
83c8ef2a42
commit
cb33cd4006
4 changed files with 146 additions and 0 deletions
22
options/device/zram.nix
Normal file
22
options/device/zram.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in a new issue