Skip to content

Commit

Permalink
Revert "nixos/monit: Allow splitting the config in multiple files"
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantm committed Sep 19, 2020
1 parent 9d9d85a commit 61863c5
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions nixos/modules/services/monitoring/monit.nix
Expand Up @@ -4,37 +4,27 @@ 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 {

environment.systemPackages = [ pkgs.monit ];

environment.etc.monitrc = {
text = concatMapStringsSep "\n" (path: "include ${path}") (cfg.configFiles ++ [extraConfig]);
text = cfg.config;
mode = "0400";
};

Expand Down

0 comments on commit 61863c5

Please sign in to comment.