about summary refs log tree commit diff
path: root/modules/nixos/monitoring/default.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/nixos/monitoring/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/nixos/monitoring/default.nix b/modules/nixos/monitoring/default.nix
index a48701e..1108be6 100644
--- a/modules/nixos/monitoring/default.nix
+++ b/modules/nixos/monitoring/default.nix
@@ -70,6 +70,40 @@ in {
             options.path = ./dashboards/postgresql.json;
           }
         ];
+
+        alerting = {
+          contactPoints.settings.contactPoints = [
+            {
+              name = "Alertmanager";
+              receivers = [
+                {
+                  uid = 1;
+                  type = "prometheus-alertmanager";
+                  settings.url = "https://${config.nixfiles.modules.alertmanager.domain}";
+                }
+              ];
+            }
+          ];
+          muteTimings.settings.muteTimes = [
+            {
+              name = "Sleep";
+              time_intervals = [
+                {
+                  times = [
+                    {
+                      start_time = "23:00";
+                      end_time = "24:00";
+                    }
+                    {
+                      start_time = "00:00";
+                      end_time = "09:00";
+                    }
+                  ];
+                }
+              ];
+            }
+          ];
+        };
       };
 
       loki.configuration.ruler.alertmanager_url = "https://${config.nixfiles.modules.alertmanager.domain}";

Consider giving Nix/NixOS a try! <3