You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
694 B

{ config, lib, pkgs, ... }:
let
grafana-sms-alert = pkgs.callPackage (fetchTarball "https://gti.telent.net/dan/grafana-sms-alert/archive/main.tar.gz") {};
smsConfig = builtins.toFile "config.json"
(builtins.toJSON {
smsc = "+447958879879";
number = "447000123456";
device = "/dev/serial/by-id/usb-HUAWEI_HUAWEI_HiLink-if00-port0";
});
in {
config.systemd.services.grafana-sms = {
description = "SMS webhook for Grafana";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Restart = "always";
SyslogIdentifier = "grafana-sms";
ExecStart = ''
${grafana-sms-alert}/bin/grafana-sms-alert ${smsConfig}
'';
};
};
}