diff options
author | Azat Bahawi <azat@bahawi.net> | 2024-03-31 21:29:27 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2024-03-31 21:29:27 +0300 |
commit | 9a5427e3a0c0ccf2a82dc503149a26b23fbd6004 (patch) | |
tree | f28beec29deeea36038615a8fb98a810891940b5 /modules/nixos/alertmanager.nix | |
parent | 2024-03-19 (diff) |
2024-03-31
Diffstat (limited to '')
-rw-r--r-- | modules/nixos/alertmanager.nix | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/nixos/alertmanager.nix b/modules/nixos/alertmanager.nix index 4d7f2ec..a3457bc 100644 --- a/modules/nixos/alertmanager.nix +++ b/modules/nixos/alertmanager.nix @@ -5,10 +5,12 @@ libNginx, ... }: -with lib; let +with lib; +let cfg = config.nixfiles.modules.alertmanager; -in { - imports = [inputs.alertmanager-ntfy.nixosModules.default]; +in +{ + imports = [ inputs.alertmanager-ntfy.nixosModules.default ]; options.nixfiles.modules.alertmanager = { enable = mkEnableOption "Alertmanager"; @@ -31,7 +33,7 @@ in { ntfy.enable = true; nginx = { enable = true; - upstreams.alertmanager.servers."127.0.0.1:${toString cfg.port}" = {}; + upstreams.alertmanager.servers."127.0.0.1:${toString cfg.port}" = { }; virtualHosts.${cfg.domain} = { locations."/".proxyPass = "http://alertmanager"; extraConfig = libNginx.config.internalOnly; @@ -59,16 +61,14 @@ in { route = { receiver = my.username; - group_by = ["alertname"]; + group_by = [ "alertname" ]; }; receivers = [ { name = my.username; webhook_configs = [ - { - url = with config.services.alertmanager-ntfy; "http://${httpAddress}:${httpPort}"; - } + { url = with config.services.alertmanager-ntfy; "http://${httpAddress}:${httpPort}"; } ]; } ]; |