Skip to content

Commit

Permalink
Merge pull request #213445 from Majiir/fix-systemd-coredump-truncation
Browse files Browse the repository at this point in the history
nixos/systemd/coredump: fix kernel.core_pattern truncation
  • Loading branch information
flokli authored Jan 30, 2023
2 parents 31931ff + 7f35c8b commit cd47b8e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion nixos/modules/system/boot/systemd/coredump.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,21 @@ in {
'';

# install provided sysctl snippets
"sysctl.d/50-coredump.conf".source = "${systemd}/example/sysctl.d/50-coredump.conf";
"sysctl.d/50-coredump.conf".source =
# Fix systemd-coredump error caused by truncation of `kernel.core_pattern`
# when the `systemd` derivation name is too long. This works by substituting
# the path to `systemd` with a symlink that has a constant-length path.
#
# See: https://github.com/NixOS/nixpkgs/issues/213408
pkgs.substitute {
src = "${systemd}/example/sysctl.d/50-coredump.conf";
replacements = [
"--replace"
"${systemd}"
"${pkgs.symlinkJoin { name = "systemd"; paths = [ systemd ]; }}"
];
};

"sysctl.d/50-default.conf".source = "${systemd}/example/sysctl.d/50-default.conf";
};

Expand Down

0 comments on commit cd47b8e

Please sign in to comment.