mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-28 01:02:35 +01:00
feat(nixos): Nix store hygiene, PostgreSQL dumps, OOM and backup quotas (#532)
Assisted-by: DeepSeek Harness (claude-opus-5-5)
This commit is contained in:
1 parent
9b1a716aa8
commit
667fd76cac
6 files changed
+88
-16
No files matched your search
+12
-1
@@ -62,7 +62,18 @@ in
|
||||
|
||||
# zram itself is provided by modules/nixos/base/zram.nix (enabled by default).
|
||||
# Kill the greediest process before the host starts thrashing / gets OOM-killed.
|
||||
services.earlyoom.enable = true;
|
||||
services.earlyoom = {
|
||||
enable = true;
|
||||
# The MicroVMs' qemu and virtiofsd are the largest processes and would be
|
||||
# killed first. Prefixes of /proc/PID/comm, which is cut to 15 characters
|
||||
# (wrapped binaries start with a dot).
|
||||
extraArgs = [
|
||||
"--avoid"
|
||||
"^(\\.qemu-system-x8|virtiofsd|\\.postgres-wrap|victoria-metric)"
|
||||
];
|
||||
};
|
||||
# Builds inherit the daemon's oom_score_adj, so earlyoom and the kernel kill them first.
|
||||
systemd.services.nix-daemon.serviceConfig.OOMScoreAdjust = 500;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Validate Hardware Virtualization Support via:
|
||||
|
||||
Reference in new issue
Block a user