This commit is contained in:
1 parent
f3876cdf87
commit
bb2f0dcd29
6 files changed
+44
-9
No files matched your search
@@ -0,0 +1,19 @@
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./oom.nix
|
||||
./zram.nix
|
||||
];
|
||||
|
||||
options.memory = {
|
||||
oom.enable = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
zram.enable = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.memory.oom.enable {
|
||||
systemd.oomd.enableUserSlices = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.memory.zram.enable {
|
||||
zramSwap.enable = true;
|
||||
boot.kernel.sysctl = {
|
||||
"vm.swappiness" = lib.mkDefault 180;
|
||||
"vm.page-cluster" = lib.mkDefault 0;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user