<commit_before>{ config, lib, pkgs, ... }:

with lib;

{

  options = {

    systemd.coredump = {

      enable = mkOption {
        default = true;
        type = types.bool;
        description = ''
          Enables storing core dumps in systemd.
          Note that this alone is not enough to enable core dumps. The maximum
          file size for core dumps must be specified in limits.conf as well. See
          <option>security.pam.loginLimits</option> as well as the limits.conf(5)
          man page.
        '';
      };

      extraConfig = mkOption {
        default = "Storage=none";
        type = types.lines;
        example = "Storage=journal";
        description = ''
          Extra config options for systemd-coredump. See coredump.conf(5) man page
          for available options.
        '';
      };
    };

  };

  config = mkMerge [
    (mkIf config.systemd.coredump.enable {

      systemd.additionalUpstreamUnits = [ "systemd-coredump.socket" "systemd-coredump@.service" ];

      environment.etc."systemd/coredump.conf".text =
        ''
          [Coredump]
          ${config.systemd.coredump.extraConfig}
        '';

      # Have the kernel pass core dumps to systemd's coredump helper binary.
      # From systemd's 50-coredump.conf file. See:
      # <https://github.com/systemd/systemd/blob/v218/sysctl.d/50-coredump.conf.in>
      boot.kernel.sysctl."kernel.core_pattern" = "|${config.systemd.package}/lib/systemd/systemd-coredump %P %u %g %s %t %c %e";
    })
<commit_msg>coredump: fix typo<commit_after>{ config, lib, pkgs, ... }:

with lib;

{

  options = {

    systemd.coredump = {

      enable = mkOption {
        default = true;
        type = types.bool;
        description = ''
          Enables storing core dumps in systemd.
          Note that this alone is not enough to enable core dumps. The maximum
          file size for core dumps must be specified in limits.conf as well. See
          <option>security.pam.loginLimits</option> as well as the limits.conf(5)
          man page.
        '';
      };

      extraConfig = mkOption {
        default = "Storage=none";
        type = types.lines;
        example = "Storage=journal";
        description = ''
          Extra config options for systemd-coredump. See coredump.conf(5) man page
          for available options.
        '';
      };
    };

  };

  config = mkMerge [
    (mkIf config.systemd.coredump.enable {

      systemd.additionalUpstreamSystemUnits = [ "systemd-coredump.socket" "systemd-coredump@.service" ];

      environment.etc."systemd/coredump.conf".text =
        ''
          [Coredump]
          ${config.systemd.coredump.extraConfig}
        '';

      # Have the kernel pass core dumps to systemd's coredump helper binary.
      # From systemd's 50-coredump.conf file. See:
      # <https://github.com/systemd/systemd/blob/v218/sysctl.d/50-coredump.conf.in>
      boot.kernel.sysctl."kernel.core_pattern" = "|${config.systemd.package}/lib/systemd/systemd-coredump %P %u %g %s %t %c %e";
    })

{'fraction_non_alphanumeric': 0.11828665568369028, 'fraction_numerical': 0.005930807248764415, 'mean_word_length': 2.120246659815005, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2750231', 'n_tokens_mistral': 953, 'n_tokens_neox': 943, 'n_words': 226}