From f36c1403009be5ccaab61ce863c08ec5a8244ea0 Mon Sep 17 00:00:00 2001 From: Timo Bingmann Date: Fri, 19 Sep 2025 22:32:52 -0700 Subject: [PATCH] Disable core dumps via pam --- system/linux/system.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/system/linux/system.nix b/system/linux/system.nix index d186d43..90cfa32 100644 --- a/system/linux/system.nix +++ b/system/linux/system.nix @@ -12,4 +12,14 @@ # Disable coredumps to prevent filling up /var/lib/systemd/coredump/ # Coredumps can quickly consume large amounts of disk space systemd.coredump.enable = false; + + # Disable core dumps. + security.pam.loginLimits = [ + { domain = "*"; item = "core"; type = "hard"; value = "0"; } + ]; + + # Don't shutdown when power button is short-pressed. + services.logind.extraConfig = '' + HandlePowerKey=ignore + ''; }