summaryrefslogtreecommitdiffstats
path: root/usecases/server/gotify-server.nix
diff options
context:
space:
mode:
Diffstat (limited to 'usecases/server/gotify-server.nix')
-rw-r--r--usecases/server/gotify-server.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/usecases/server/gotify-server.nix b/usecases/server/gotify-server.nix
new file mode 100644
index 0000000..5445827
--- /dev/null
+++ b/usecases/server/gotify-server.nix
@@ -0,0 +1,46 @@
1inputs:
2
3{ config, ... }:
4
5{
6 services.gotify = {
7 enable = true;
8 port = 8082;
9 };
10
11 # TODO: add proper boot notification
12
13 /*
14 systemd.services.gotify-notify-boot = {
15 after = [ "gotify-server.service" ];
16 wantedBy = [ "multi-user.target" ];
17
18 restartIfChanged = false;
19
20 serviceConfig = {
21 Type = "oneshot";
22
23 # Priority is needed because there is no configuration, hence no default
24 # priority to fallback to
25 ExecStart = let params = lib.cli.toGNUCommandLineShell { } {
26 url = "http://localhost:${toString config.services.gotify.port}";
27 token = "$GOTIFY_TOKEN";
28 priority = 0;
29 };
30 in "${pkgs.gotify-cli}/bin/gotify push ${params} 'The system has booted'";
31
32 RemainAfterExit = "yes";
33 # Adds lots of security options
34 DynamicUser = "yes";
35 EnvironmentFile = "/etc/nixos/res/gotify-config.env";
36
37 Restart = "on-failure";
38 RestartSec = "3s";
39 };
40 };
41 */
42
43 networking.firewall.interfaces.${config.topology.mainVpn.interfaceName}.allowedTCPPorts = [
44 config.services.gotify.port
45 ];
46}