23 lines
694 B
Nix
23 lines
694 B
Nix
|
{ 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}
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
}
|