blob: 87df67d2801757c340020e4b746260b121d3592a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
{ lib, pkgs, ... }:
let
settings = import ../../settings.nix { inherit lib; };
host = settings.network.host;
ports = settings.network.ports;
url = "http://${host}:${toString ports.ntfy}";
in
{
networking.firewall.allowedTCPPorts = [ ports.ntfy ];
services.ntfy-sh = {
enable = true;
settings = {
listen-http = ":${toString ports.ntfy}";
base-url = url;
};
};
environment.systemPackages = [
(pkgs.writeShellScriptBin "push-ntfy" ''
set -eu;
topic="$1"; shift 1;
body="$1"; shift 1;
${pkgs.ntfy-sh}/bin/ntfy pub "$@" "${url}/$topic" "$body"
'')
];
}
|