<commit_before>{ config, lib, pkgs, ... }:
with lib;
let
  cfg = config.services.sysstat;
in {
  options = {
    services.sysstat = {
      enable = mkOption {
        type = types.bool;
        default = false;
        description = ''
          Whether to enable sar system activity collection.
        '';
      };

      collect-frequency = mkOption {
        default = "*:00/10";
        description = ''
          OnCalendar specification for sysstat-collect
        '';
      };

      collect-args = mkOption {
        default = "1 1";
        description = ''
          Arguments to pass sa1 when collecting statistics
        '';
      };
    };
  };

  config = mkIf cfg.enable {
    systemd.services.sysstat = {
      description = "Resets System Activity Logs";
      wantedBy = [ "multi-user.target" ];
      preStart = "test -d /var/log/sa || mkdir -p /var/log/sa";

      serviceConfig = {
        User = "root";
        RemainAfterExit = true;
        Type = "oneshot";
        ExecStart = "${pkgs.sysstat}/lib/sa/sa1 --boot";
      };
    };

    systemd.services.sysstat-collect = {
      description = "system activity accounting tool";
      unitConfig.Documentation = "man:sa1(8)";
<commit_msg>nixos/sysstat: provide a type for each module option<commit_after>{ config, lib, pkgs, ... }:
with lib;
let
  cfg = config.services.sysstat;
in {
  options = {
    services.sysstat = {
      enable = mkEnableOption "sar system activity collection";

      collect-frequency = mkOption {
        type = types.str;
        default = "*:00/10";
        description = ''
          OnCalendar specification for sysstat-collect
        '';
      };

      collect-args = mkOption {
        type = types.str;
        default = "1 1";
        description = ''
          Arguments to pass sa1 when collecting statistics
        '';
      };
    };
  };

  config = mkIf cfg.enable {
    systemd.services.sysstat = {
      description = "Resets System Activity Logs";
      wantedBy = [ "multi-user.target" ];

      serviceConfig = {
        User = "root";
        RemainAfterExit = true;
        Type = "oneshot";
        ExecStart = "${pkgs.sysstat}/lib/sa/sa1 --boot";
        LogsDirectory = "sa";
      };
    };

    systemd.services.sysstat-collect = {
      description = "system activity accounting tool";
      unitConfig.Documentation = "man:sa1(8)";

{'fraction_non_alphanumeric': 0.12579147319544112, 'fraction_numerical': 0.008442380751371888, 'mean_word_length': 1.933168316831683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '6262327', 'n_tokens_mistral': 706, 'n_tokens_neox': 684, 'n_words': 166}