diff options
Diffstat (limited to 'nixos/modules/services/monitoring/monit.nix')
-rw-r--r-- | nixos/modules/services/monitoring/monit.nix | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/nixos/modules/services/monitoring/monit.nix b/nixos/modules/services/monitoring/monit.nix index aa51b83912c..379ee967620 100644 --- a/nixos/modules/services/monitoring/monit.nix +++ b/nixos/modules/services/monitoring/monit.nix @@ -4,29 +4,19 @@ with lib; let cfg = config.services.monit; - extraConfig = pkgs.writeText "monitConfig" cfg.extraConfig; in { - imports = [ - (mkRenamedOptionModule [ "services" "monit" "config" ] ["services" "monit" "extraConfig" ]) - ]; - options.services.monit = { enable = mkEnableOption "Monit"; - configFiles = mkOption { - type = types.listOf types.path; - default = []; - description = "List of paths to be included in the monitrc file"; - }; - - extraConfig = mkOption { + config = mkOption { type = types.lines; default = ""; - description = "Additional monit config as string"; + description = "monitrc content"; }; + }; config = mkIf cfg.enable { @@ -34,7 +24,7 @@ in environment.systemPackages = [ pkgs.monit ]; environment.etc.monitrc = { - text = concatMapStringsSep "\n" (path: "include ${path}") (cfg.configFiles ++ [extraConfig]); + text = cfg.config; mode = "0400"; }; @@ -53,4 +43,6 @@ in }; }; + + meta.maintainers = with maintainers; [ ryantm ]; } |