feat(desktop): add earlyoom and nix build fixes for ram management.
This commit is contained in:
parent
3508c28bf1
commit
d9607b064a
2 changed files with 19 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
17
modules/linux/nixos/oom.nix
Normal file
17
modules/linux/nixos/oom.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue