mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-01 14:29:40 +00:00
16 lines
391 B
Nix
16 lines
391 B
Nix
# Protect my system from running out of storage or memory
|
|
let
|
|
totalStorage = 930;
|
|
in
|
|
{
|
|
nix.settings = {
|
|
min-free = builtins.ceil (totalStorage * 0.2) * 1024 * 1024 * 1024;
|
|
max-free = builtins.ceil (totalStorage * 0.3) * 1024 * 1024 * 1024;
|
|
};
|
|
|
|
systemd.services.nix-daemon.serviceConfig = {
|
|
MemoryAccounting = true;
|
|
MemoryMax = "90%";
|
|
OOMScoreAdjust = 500;
|
|
};
|
|
}
|