<commit_before># Monit system watcher
# http://mmonit.org/monit/

{config, pkgs, ...}: 

let inherit (pkgs.lib) mkOption;
in

{
  options = {
    services.monit = {
      enable = mkOption {
        default = false;
        description = ''
          Whether to run Monit system watcher.
        '';
      };
      config = mkOption {
        default = "";
        description = "monit.conf content";
      };
      startOn = mkOption {
        default = "networking/started";
        description = "What Monit supposes to be already present";
      };
    };
  };
  
  config = {
    environment.etc = [
      {
        source = pkgs.writeTextFile {
          name = "monit.conf";
          text = config.services.monit.config;
        };
        target = "monit.conf";
        mode = "0400";
      }
    ];
    jobs.monit = {
      description = "Monit system watcher";
      
      startOn = config.services.monit.startOn;
      stopOn = "shutdown";

      exec = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf";

      respawn = true;
    };
  };
}
<commit_msg>Make monit actually switchable off<commit_after># Monit system watcher
# http://mmonit.org/monit/

{config, pkgs, ...}: 

let inherit (pkgs.lib) mkOption mkIf;
in

{
  options = {
    services.monit = {
      enable = mkOption {
        default = false;
        description = ''
          Whether to run Monit system watcher.
        '';
      };
      config = mkOption {
        default = "";
        description = "monit.conf content";
      };
      startOn = mkOption {
        default = "networking/started";
        description = "What Monit supposes to be already present";
      };
    };
  };
  
  config = {
    environment.etc = [
      {
        source = pkgs.writeTextFile {
          name = "monit.conf";
          text = config.services.monit.config;
        };
        target = "monit.conf";
        mode = "0400";
      }
    ];
    jobs.monit = mkIf config.services.monit.enable {
      description = "Monit system watcher";
      
      startOn = config.services.monit.startOn;
      stopOn = "shutdown";

      exec = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf";

      respawn = true;
    };
  };
}

{'fraction_non_alphanumeric': 0.1319634703196347, 'fraction_numerical': 0.0036529680365296802, 'mean_word_length': 1.714993804213135, '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': '3296016', 'n_tokens_mistral': 709, 'n_tokens_neox': 694, 'n_words': 149}