feat(desktop): add earlyoom and nix build fixes for ram management.

This commit is contained in:
CronyAkatsuki 2025-06-20 17:53:44 +02:00
parent 3508c28bf1
commit d9607b064a
2 changed files with 19 additions and 0 deletions

View file

@ -24,6 +24,7 @@
./nh.nix
./ollama.nix
./secrets.nix
./oom.nix
];
crony.bluetooth.enable = lib.mkDefault true;
@ -50,4 +51,5 @@
crony.nh.enable = lib.mkDefault true;
crony.ollama.enable = lib.mkDefault false;
crony.secrets.enable = lib.mkDefault false;
crony.oom.enable = lib.mkDefault true;
}

View file

@ -0,0 +1,17 @@
{
config,
lib,
...
}: {
options = {
crony.oom.enable = lib.mkEnableOption "Enable and setup settings for better oom management on a desktop system and nix build.";
};
config = lib.mkIf config.crony.oom.enable {
nix.settings.max-jobs = 8;
services.earlyoom = {
enable = true;
enableNotifications = true;
};
};
}