From bdbdaee3c052474d0a208bea0fca0b1528e40336 Mon Sep 17 00:00:00 2001 From: Rickard Nilsson Date: Wed, 18 Mar 2015 21:16:23 +0100 Subject: [PATCH] scollector module: Add extraOpts option --- .../modules/services/monitoring/scollector.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/monitoring/scollector.nix b/nixos/modules/services/monitoring/scollector.nix index ce70739abbc..0143d2e327b 100644 --- a/nixos/modules/services/monitoring/scollector.nix +++ b/nixos/modules/services/monitoring/scollector.nix @@ -20,6 +20,10 @@ let cfg.collectors)} ''; + cmdLineOpts = concatStringsSep " " ( + [ "-h=${cfg.bosunHost}" "-c=${collectors}" ] ++ cfg.extraOpts + ); + in { options = { @@ -79,6 +83,15 @@ in { ''; }; + extraOpts = mkOption { + type = with types; listOf str; + default = []; + example = [ "-d" ]; + description = '' + Extra scollector command line options + ''; + }; + }; }; @@ -95,9 +108,7 @@ in { PermissionsStartOnly = true; User = cfg.user; Group = cfg.group; - ExecStart = '' - ${cfg.package}/bin/scollector -h=${cfg.bosunHost} -c=${collectors} - ''; + ExecStart = "${cfg.package}/bin/scollector ${cmdLineOpts}"; }; };