Add riemann-tools to nixpkgs

Adds package via bundlerEnv and service for Riemann health.
This commit is contained in:
Robert Pitts and Trenton Strong
2015-06-30 17:16:51 -04:00
committed by Robert Pitts
parent a612e397d8
commit bbb36ea039
8 changed files with 663 additions and 0 deletions
+2
View File
@@ -221,6 +221,7 @@
skydns = 197;
ripple-rest = 198;
nix-serve = 199;
riemanntools = 200;
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
@@ -420,6 +421,7 @@
#skydns = 197; #unused
#ripple-rest = 198; #unused
#nix-serve = 199; #unused
riemanntools = 200;
# When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal
+1
View File
@@ -233,6 +233,7 @@
./services/monitoring/nagios.nix
./services/monitoring/riemann.nix
./services/monitoring/riemann-dash.nix
./services/monitoring/riemann-tools.nix
./services/monitoring/scollector.nix
./services/monitoring/smartd.nix
./services/monitoring/statsd.nix
@@ -0,0 +1,62 @@
{ config, pkgs, lib, ... }:
with pkgs;
with lib;
let
cfg = config.services.riemann-tools;
riemannHost = "${cfg.riemannHost}";
healthLauncher = writeScriptBin "riemann-health" ''
#!/bin/sh
exec ${pkgs.riemann-tools}/bin/riemann-health --host ${riemannHost}
'';
in {
options = {
services.riemann-tools = {
enableHealth = mkOption {
type = types.bool;
default = false;
description = ''
Enable the riemann-health daemon.
'';
};
riemannHost = mkOption {
type = types.str;
default = "127.0.0.1";
description = ''
Address of the host riemann node. Defaults to localhost.
'';
};
};
};
config = mkIf cfg.enableHealth {
users.extraGroups.riemanntools.gid = config.ids.gids.riemanntools;
users.extraUsers.riemanntools = {
description = "riemann-tools daemon user";
uid = config.ids.uids.riemanntools;
group = "riemanntools";
};
systemd.services.riemann-health = {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = "riemanntools";
ExecStart = "${healthLauncher}/bin/riemann-health";
PermissionsStartOnly = true;
};
};
};
}