mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-01 14:39:39 +00:00
hetzner_benchmark/sane-nix: init
storage and memory protection
This commit is contained in:
parent
46983687c0
commit
317e43e9a0
1 changed files with 21 additions and 0 deletions
21
nix/configurations/hetzner_benchmark/nixos/sane-nix.nix
Normal file
21
nix/configurations/hetzner_benchmark/nixos/sane-nix.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Protect my system from running out of storage or memory
|
||||
{
|
||||
# 500GB Storage
|
||||
nix.settings = {
|
||||
min-free = 20 * 1024 * 1024 * 1024;
|
||||
max-free = 50 * 1024 * 1024 * 1024;
|
||||
};
|
||||
|
||||
systemd.services.nix-daemon.serviceConfig = {
|
||||
MemoryAccounting = true;
|
||||
MemoryMax = "90%";
|
||||
OOMScoreAdjust = 500;
|
||||
};
|
||||
|
||||
# 12 Cores, 64 GB RAM
|
||||
# split into 4 jobs with 3C/16G
|
||||
nix.settings = {
|
||||
cores = 3;
|
||||
max-jobs = 4;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue