mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 08:33:55 -05:00
add systemConfig.zramSwap.size option and set new defaults
This commit is contained in:
parent
ec66205035
commit
178c2e8c11
|
@ -28,7 +28,9 @@
|
|||
|
||||
systemConfig = {
|
||||
plymouth.enable = true;
|
||||
zramSwap.enable = true;
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
desktopConfig = {
|
||||
|
|
|
@ -27,7 +27,10 @@
|
|||
};
|
||||
|
||||
systemConfig = {
|
||||
zramSwap.enable = true;
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
size = 100;
|
||||
};
|
||||
};
|
||||
|
||||
homeLab.enable = true;
|
||||
|
|
|
@ -83,7 +83,9 @@ in {
|
|||
|
||||
systemConfig = {
|
||||
plymouth.enable = true;
|
||||
zramSwap.enable = true;
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
apps = {
|
||||
|
|
|
@ -19,7 +19,10 @@
|
|||
|
||||
systemConfig = {
|
||||
plymouth.enable = true;
|
||||
zramSwap.enable = true;
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
size = 100;
|
||||
};
|
||||
};
|
||||
|
||||
desktopConfig = {
|
||||
|
|
|
@ -2,12 +2,17 @@
|
|||
|
||||
options = {
|
||||
systemConfig.zramSwap.enable = lib.mkEnableOption "Enables zram swap.";
|
||||
systemConfig.zramSwap.size = lib.mkOption {
|
||||
description = "Percent size of the zram swap.";
|
||||
default = 50;
|
||||
type = lib.types.int;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.systemConfig.zramSwap.enable {
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
memoryPercent = 25;
|
||||
memoryPercent = config.systemConfig.zramSwap.size;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue