git.iko.soy/typeable/nixpkgs
on master help sign in
prometheus-xmpp-alerts: apply RFC 42
commit03c092579a32d05de1ecc46b8307e5da06ed57b6 authorGeorg Haas <hax404foogit@hax404.de> dateThu 29 Apr 2021, 23:30 (6 years ago) parent41f448f
1 file changed+17−9
nixos/modules/services/monitoring/prometheus/xmpp-alerts.nix+17−9
nixos/modules/services/monitoring/prometheus/xmpp-alerts.nix+17−9
@@ -4,21 +4,29 @@ with lib;
44
55let
66 cfg = config.services.prometheus.xmpp-alerts;
7−
8− configFile = pkgs.writeText "prometheus-xmpp-alerts.yml" (builtins.toJSON cfg.configuration);
9−
7+ settingsFormat = pkgs.formats.yaml {};
8+ configFile = settingsFormat.generate "prometheus-xmpp-alerts.yml" cfg.settings;
109in
11−
1210{
13− options.services.prometheus.xmpp-alerts = {
11+ imports = [
12+ (mkRenamedOptionModule
13+ [ "services" "prometheus" "xmpp-alerts" "configuration" ]
14+ [ "services" "prometheus" "xmpp-alerts" "settings" ])
15+ ];
1416
17+ options.services.prometheus.xmpp-alerts = {
1518 enable = mkEnableOption "XMPP Web hook service for Alertmanager";
1619
17− configuration = mkOption {
18− type = types.attrs;
19− description = "Configuration as attribute set which will be converted to YAML";
20− };
20+ settings = mkOption {
21+ type = settingsFormat.type;
22+ default = {};
2123
24+ description = ''
25+ Configuration for prometheus xmpp-alerts, see
26+ <link xlink:href="https://github.com/jelmer/prometheus-xmpp-alerts/blob/master/xmpp-alerts.yml.example"/>
27+ for supported values.
28+ '';
29+ };
2230 };
2331
2432 config = mkIf cfg.enable {