1 { config, pkgs, lib, ... }:
8 cfg = config.services.riemann-tools;
10 riemannHost = "${cfg.riemannHost}";
12 healthLauncher = writeScriptBin "riemann-health" ''
14 exec ${pkgs.riemann-tools}/bin/riemann-health ${builtins.concatStringsSep " " cfg.extraArgs} --host ${riemannHost}
22 services.riemann-tools = {
23 enableHealth = mkOption {
27 Enable the riemann-health daemon.
30 riemannHost = mkOption {
32 default = "127.0.0.1";
34 Address of the host riemann node. Defaults to localhost.
37 extraArgs = mkOption {
38 type = types.listOf types.str;
41 A list of commandline-switches forwarded to a riemann-tool.
42 See for example `riemann-health --help` for available options.
44 example = ["-p 5555" "--timeout=30" "--attribute=myattribute=42"];
49 config = mkIf cfg.enableHealth {
51 users.groups.riemanntools.gid = config.ids.gids.riemanntools;
53 users.users.riemanntools = {
54 description = "riemann-tools daemon user";
55 uid = config.ids.uids.riemanntools;
56 group = "riemanntools";
59 systemd.services.riemann-health = {
60 wantedBy = [ "multi-user.target" ];
63 User = "riemanntools";
64 ExecStart = "${healthLauncher}/bin/riemann-health";