about summary refs log tree commit diff
path: root/nix/hosts/corrino
diff options
context:
space:
mode:
Diffstat (limited to 'nix/hosts/corrino')
-rw-r--r--nix/hosts/corrino/ports.nix1
-rw-r--r--nix/hosts/corrino/www/stats.emile.space.nix22
2 files changed, 23 insertions, 0 deletions
diff --git a/nix/hosts/corrino/ports.nix b/nix/hosts/corrino/ports.nix
index b83b118..10ae593 100644
--- a/nix/hosts/corrino/ports.nix
+++ b/nix/hosts/corrino/ports.nix
@@ -23,6 +23,7 @@
     netbox = 8001;
     restic = 8002;
     nocodb = 8003;
+    goatcounter = 8004;
     r2wars-web = 8089;
     ctf = 8338;
     magic-hash = 8339;
diff --git a/nix/hosts/corrino/www/stats.emile.space.nix b/nix/hosts/corrino/www/stats.emile.space.nix
new file mode 100644
index 0000000..056c2ec
--- /dev/null
+++ b/nix/hosts/corrino/www/stats.emile.space.nix
@@ -0,0 +1,22 @@
+{ config, pkgs, ... }:
+
+{
+  services.nginx.virtualHosts."stats.emile.space" = {
+    forceSSL = true;
+    enableACME = true;
+    locations = {
+      "/" = {
+        proxyPass = "http://[::1]:${toString config.services.goatcounter.port}";
+      };
+    };
+  };
+
+  services.goatcounter = {
+    enable = true;
+    package = pkgs.goatcounter;
+
+    proxy = true;
+    address = "[::1]";
+    port = config.emile.ports.goatcounter;
+  };
+}