-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathactual.nix
69 lines (65 loc) · 1.63 KB
/
actual.nix
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,
globals,
nodes,
...
}:
let
actualDomain = "finance.${globals.domains.me}";
in
{
wireguard.proxy-sentinel = {
client.via = "sentinel";
firewallRuleForNode.sentinel.allowedTCPPorts = [ config.services.actual.settings.port ];
};
environment.persistence."/persist".directories = [
{
directory = "/var/lib/actual";
mode = "0700";
user = "actual";
group = "actual";
}
];
services.actual = {
enable = true;
settings.trustedProxies = [ nodes.sentinel.config.wireguard.proxy-sentinel.ipv4 ];
};
globals.services.actual.domain = actualDomain;
globals.monitoring.http.actual = {
url = "https://${actualDomain}/";
expectedBodyRegex = "Actual";
network = "internet";
};
nodes.sentinel = {
services.nginx = {
upstreams.actual = {
servers."${config.wireguard.proxy-sentinel.ipv4}:${toString config.services.actual.settings.port}" =
{ };
extraConfig = ''
zone actual 64k;
keepalive 2;
'';
monitoring = {
enable = true;
expectedBodyRegex = "Actual";
};
};
virtualHosts.${actualDomain} = {
forceSSL = true;
useACMEWildcardHost = true;
# oauth2 = {
# enable = true;
# allowedGroups = ["access_openwebui"];
# X-Email = "\${upstream_http_x_auth_request_preferred_username}@${globals.domains.personal}";
# };
extraConfig = ''
client_max_body_size 256M;
'';
locations."/" = {
proxyPass = "http://actual";
proxyWebsockets = true;
};
};
};
};
}