blob: b463b27dbe56259bb804adc10c8f946f6f4ceda3 (
plain)
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
|
{
me,
pkgs,
auxiliaryPkgs,
...
}:
let
inherit (pkgs) dockerTools;
inherit (auxiliaryPkgs) common;
goatcounter = pkgs.goatcounter;
goatcounterLocalPort = 7151;
goatcounterDir = "/srv/goatcounter";
goatcounterImage = dockerTools.streamLayeredImage {
name = "goatcounter";
tag = goatcounter.version;
fromImage = common.alpine.base;
contents = [ goatcounter ];
};
in
{
foundation.services.goatcounter = {
image = goatcounterImage;
ports = [
[
goatcounterLocalPort
8080
]
];
volumes = [
[
"${goatcounterDir}"
"/goatcounter"
]
];
entrypoint = "${goatcounter}/bin/goatcounter";
cmd = [
"serve"
"-automigrate"
"-listen=:8080"
"-tls=none"
"-db=sqlite+/goatcounter/db.sqlite3"
];
};
services.nginx.virtualHosts."goat.rnrd.eu" = {
useACMEHost = "rnrd.eu";
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString goatcounterLocalPort}/";
proxyWebsockets = true;
};
extraConfig = ''
access_log /var/log/nginx/goat.access.log json_combined;
'';
};
}
|