feat(memory): declare 'memory' module
check / lint (push) Successful in 15s

This commit is contained in:
hektor committed 2026-10-24 13:22:38 +02:00
1 parent f3876cdf87
commit bb2f0dcd29
6 files changed
+44 -9

No files matched your search

+2 -4
View File
@@ -5,10 +5,8 @@
system.autoUpgrade.enable = false;
nix.settings.max-jobs = 0;
zramSwap = {
enable = true;
memoryPercent = 100;
};
memory.zram.enable = true;
zramSwap.memoryPercent = 100;
services.journald.settings.Journal.SystemMaxUse = "100M";
};
+19
View File
@@ -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;
};
};
}
+7
View File
@@ -0,0 +1,7 @@
{ config, lib, ... }:
{
config = lib.mkIf config.memory.oom.enable {
systemd.oomd.enableUserSlices = lib.mkDefault true;
};
}
+11
View File
@@ -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;
};
};
}