prometheus-xmpp-alerts: apply RFC 42
This commit is contained in:
parent
41f448f2fc
commit
03c092579a
@ -4,21 +4,29 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.prometheus.xmpp-alerts;
|
cfg = config.services.prometheus.xmpp-alerts;
|
||||||
|
settingsFormat = pkgs.formats.yaml {};
|
||||||
configFile = pkgs.writeText "prometheus-xmpp-alerts.yml" (builtins.toJSON cfg.configuration);
|
configFile = settingsFormat.generate "prometheus-xmpp-alerts.yml" cfg.settings;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
options.services.prometheus.xmpp-alerts = {
|
imports = [
|
||||||
|
(mkRenamedOptionModule
|
||||||
|
[ "services" "prometheus" "xmpp-alerts" "configuration" ]
|
||||||
|
[ "services" "prometheus" "xmpp-alerts" "settings" ])
|
||||||
|
];
|
||||||
|
|
||||||
|
options.services.prometheus.xmpp-alerts = {
|
||||||
enable = mkEnableOption "XMPP Web hook service for Alertmanager";
|
enable = mkEnableOption "XMPP Web hook service for Alertmanager";
|
||||||
|
|
||||||
configuration = mkOption {
|
settings = mkOption {
|
||||||
type = types.attrs;
|
type = settingsFormat.type;
|
||||||
description = "Configuration as attribute set which will be converted to YAML";
|
default = {};
|
||||||
};
|
|
||||||
|
|
||||||
|
description = ''
|
||||||
|
Configuration for prometheus xmpp-alerts, see
|
||||||
|
<link xlink:href="https://github.com/jelmer/prometheus-xmpp-alerts/blob/master/xmpp-alerts.yml.example"/>
|
||||||
|
for supported values.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user