aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/monitoring/monit.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/monitoring/monit.nix')
-rw-r--r--nixpkgs/nixos/modules/services/monitoring/monit.nix18
1 files changed, 14 insertions, 4 deletions
diff --git a/nixpkgs/nixos/modules/services/monitoring/monit.nix b/nixpkgs/nixos/modules/services/monitoring/monit.nix
index ca935227217..aa51b83912c 100644
--- a/nixpkgs/nixos/modules/services/monitoring/monit.nix
+++ b/nixpkgs/nixos/modules/services/monitoring/monit.nix
@@ -4,19 +4,29 @@ 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";
- config = mkOption {
+ configFiles = mkOption {
+ type = types.listOf types.path;
+ default = [];
+ description = "List of paths to be included in the monitrc file";
+ };
+
+ extraConfig = mkOption {
type = types.lines;
default = "";
- description = "monitrc content";
+ description = "Additional monit config as string";
};
-
};
config = mkIf cfg.enable {
@@ -24,7 +34,7 @@ in
environment.systemPackages = [ pkgs.monit ];
environment.etc.monitrc = {
- text = cfg.config;
+ text = concatMapStringsSep "\n" (path: "include ${path}") (cfg.configFiles ++ [extraConfig]);
mode = "0400";
};