diff --git a/ops/nixos/totoro/default.nix b/ops/nixos/totoro/default.nix index 4e083631be..2187b37f04 100644 --- a/ops/nixos/totoro/default.nix +++ b/ops/nixos/totoro/default.nix @@ -200,6 +200,22 @@ in { pushgateway.enable = true; + rules = [ + '' + groups: + - name: valve_index + rules: + - alert: ValveIndexInStock + expr: valve_index_in_stock == 0 + for: 1s + labels: + severity: page + annotations: + summary: "Valve Index in Stock!" + description: "The Valve Index is back in stock." + '' + ]; + alertmanager = { enable = true; configuration = { @@ -265,5 +281,20 @@ in { }; }; + systemd.services.valveindexinstock = { + enable = true; + serviceConfig = { + ExecStart = "${depot.py.valveindexinstock}/bin/valveindexinstock"; + DynamicUser = true; + MountAPIVFS = true; + PrivateTmp = true; + PrivateUsers = true; + ProtectControlGroups = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + }; + }; + my.prometheus.additionalExporterPorts.valveindexinstock = 9998; + system.stateVersion = "20.03"; }