Skip to content

Commit

Permalink
nixos/metricbeat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
betaboon committed Mar 21, 2019
1 parent e52de4e commit 775f0b0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@
./services/logging/syslog-ng.nix
./services/logging/syslogd.nix
./services/logging/beats/apm-server.nix
./services/logging/beats/metricbeat.nix
./services/mail/clamsmtp.nix
./services/mail/davmail.nix
./services/mail/dkimproxy-out.nix
Expand Down
42 changes: 42 additions & 0 deletions nixos/modules/services/logging/beats/metricbeat.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ config, lib, pkgs, ... }:

with lib;

let

beatslib = import ./lib.nix { inherit lib pkgs; };

mkMetricbeatConfig = cfg: {

metricbeat.modules = cfg.modules;

};

in
{
options = {

services.beats.metricbeat = beatslib.mkCommonOptions {
name = "metricbeat";
defaults = { package = pkgs.metricbeat; };
} // {

modules = mkOption {
description = ''
Modules Configuration.
See <link xlink:hfref="https://github.com/elastic/beats/blob/master/metricbeat/metricbeat.reference.yml" />
'';
type = with types; listOf attrs;
default = [];
};

};
};

config = beatslib.mkNixosConfig {
mkBeatConfig = mkMetricbeatConfig;
cfg = config.services.beats.metricbeat;
};

}

0 comments on commit 775f0b0

Please sign in to comment.