nixos/prometheus: add package option

With a package option we can let the user decide what package to use for
prometheus without requiring an overlay.
This commit is contained in:
Andreas Rammhold 2018-11-04 14:28:53 +01:00 committed by Robin Gloster
parent 05f368b60a
commit 0de150e0f2

@ -376,6 +376,15 @@ in {
'';
};
package = mkOption {
type = types.package;
default = pkgs.prometheus;
defaultText = "pkgs.prometheus";
description = ''
The prometheus package that should be used.
'';
};
listenAddress = mkOption {
type = types.str;
default = "0.0.0.0:9090";
@ -495,7 +504,7 @@ in {
after = [ "network.target" ];
script = ''
#!/bin/sh
exec ${pkgs.prometheus}/bin/prometheus \
exec ${cfg.package}/bin/prometheus \
${concatStringsSep " \\\n " cmdlineArgs}
'';
serviceConfig = {