vanadium/sane-nix: init

Setup memory && storage protection mechanisms
This commit is contained in:
Primrose 2026-01-01 21:40:59 +01:00
parent 41d9620820
commit f471cfc438
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 14 additions and 0 deletions

View file

@ -88,6 +88,7 @@ in
# NixOS modules # NixOS modules
# #
./vanadium/nixos/hardware-configuration.nix # generated ./vanadium/nixos/hardware-configuration.nix # generated
./vanadium/nixos/sane-nix.nix
./vanadium/nixos/fs.nix ./vanadium/nixos/fs.nix
./vanadium/nixos/restic.nix ./vanadium/nixos/restic.nix

View file

@ -0,0 +1,13 @@
# Protect my system from running out of storage or memory
{
nix.settings = {
min-free = 50 * 1024 * 1024 * 1024;
max-free = 100 * 1024 * 1024 * 1024;
};
systemd.services.nix-daemon.serviceConfig = {
MemoryAccounting = true;
MemoryMax = "90%";
OOMScoreAdjust = 500;
};
}