summary refs log tree commit diff
path: root/nixos/modules/system/boot/systemd.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-10-07 20:24:29 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-10-07 20:28:13 +0200
commit37c22b9d308a2536eb8a3d07919fcc29ac9c7101 (patch)
tree98e1efac839055f97cc3cf61f1887b4f74fe8df6 /nixos/modules/system/boot/systemd.nix
parent5200f5fafcedb608c0d2fe86feb683a07ff71985 (diff)
downloadnixpkgs-37c22b9d308a2536eb8a3d07919fcc29ac9c7101.tar
nixpkgs-37c22b9d308a2536eb8a3d07919fcc29ac9c7101.tar.gz
nixpkgs-37c22b9d308a2536eb8a3d07919fcc29ac9c7101.tar.bz2
nixpkgs-37c22b9d308a2536eb8a3d07919fcc29ac9c7101.tar.lz
nixpkgs-37c22b9d308a2536eb8a3d07919fcc29ac9c7101.tar.xz
nixpkgs-37c22b9d308a2536eb8a3d07919fcc29ac9c7101.tar.zst
nixpkgs-37c22b9d308a2536eb8a3d07919fcc29ac9c7101.zip
Revive systemd.coredump.enable
Diffstat (limited to 'nixos/modules/system/boot/systemd.nix')
-rw-r--r--nixos/modules/system/boot/systemd.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 5cf437bfbcb..669eb6a7056 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -546,6 +546,16 @@ in
       '';
     };
 
+    systemd.coredump.enable = mkOption {
+      default = true;
+      type = types.bool;
+      description = ''
+        Whether core dumps should be processed by
+        <command>systemd-coredump</command>. If disabled, core dumps
+        appear in the current directory of the crashing process.
+      '';
+    };
+
     systemd.coredump.extraConfig = mkOption {
       default = "";
       type = types.lines;
@@ -983,6 +993,10 @@ in
     # Don't bother with certain units in containers.
     systemd.services.systemd-remount-fs.unitConfig.ConditionVirtualization = "!container";
     systemd.services.systemd-random-seed.unitConfig.ConditionVirtualization = "!container";
+
+    boot.kernel.sysctl = mkIf (!cfg.coredump.enable) {
+      "kernel.core_pattern" = "core";
+    };
   };
 
   # FIXME: Remove these eventually.