-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotifs.nix
More file actions
69 lines (63 loc) · 1.8 KB
/
notifs.nix
File metadata and controls
69 lines (63 loc) · 1.8 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
config,
lib,
pkgs,
inputs,
...
}:
with lib;
let
cfg = config.hosts.notifications;
in
{
options.hosts.notifications = {
enable = mkEnableOption "Gotify + smtp bridge";
};
config = mkIf cfg.enable {
services.caddy.virtualHosts."notifications.thuis".extraConfig = ''
import headscale
handle @internal {
reverse_proxy http://localhost:${toString config.services.gotify.environment.GOTIFY_SERVER_PORT}
}
respond 403
'';
services.borgbackup.jobs.default.paths = [ config.services.gotify.stateDirectoryName ];
age.secrets.mailrise.file = "${inputs.secrets}/mailrise.age";
systemd.services.smtp-gotify = {
description = "SMTP to Gotify Bridge";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
ExecStart = "${pkgs.smtp-gotify}/bin/smtp-gotify";
DynamicUser = true;
Environment = [
"SG_SMTP_LISTEN=0.0.0.0:8025"
"GOTIFY_URL=https://notifications.thuis"
"SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"
];
EnvironmentFile = config.age.secrets.mailrise.path;
Restart = "on-failure";
RestartSec = "5s";
LockPersonality = true;
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;
PrivateDevices = true;
PrivateUsers = true;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
};
};
services.gotify = {
enable = true;
environment.GOTIFY_SERVER_PORT = 2230;
};
};
}