diff options
author | Alan Pearce | 2024-06-29 14:57:42 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-29 14:57:42 +0200 |
commit | fdb646b04e0e7fc49b9f20ae4f54e1d41f582f9d (patch) | |
tree | fa0526a1158b7451baa10f4387279e684eac8e83 | |
parent | abfb9a47ca8ea24287a94e00340ff193badf5327 (diff) | |
download | nixfiles-fdb646b04e0e7fc49b9f20ae4f54e1d41f582f9d.tar.lz nixfiles-fdb646b04e0e7fc49b9f20ae4f54e1d41f582f9d.tar.zst nixfiles-fdb646b04e0e7fc49b9f20ae4f54e1d41f582f9d.zip |
linde: set up goatcounter
m--------- | packages | 0 | ||||
-rw-r--r-- | system/linde.nix | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/packages b/packages -Subproject e44b42f082aee425459182711649283986ef5e4 +Subproject 1f22eb1d157275d40400c83b57fac4ad65ecb1a diff --git a/system/linde.nix b/system/linde.nix index 2ae0b714..3a4b66ec 100644 --- a/system/linde.nix +++ b/system/linde.nix @@ -22,6 +22,7 @@ in imports = [ <personal/modules/nixos/laminar.nix> + <personal/modules/nixos/goatcounter.nix> <home-manager/nixos> <agenix/modules/age.nix> <searchix/nix/modules> @@ -344,6 +345,17 @@ in # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "23.05"; # Did you read the comment? + services.goatcounter = { + enable = true; + listenAddress = "localhost"; + port = 8082; + package = (import <personal> { inherit pkgs; }).goatcounter; + settings = { + tls = "proxy"; + websocket = true; + }; + }; + services.powerdns = let inherit (lib.lists) flatten; @@ -597,6 +609,9 @@ in reloadServices = map (x: "kresd@${toString x}") (range 1 config.services.kresd.instances); group = "knot-resolver"; }; + certs."stats.alanpearce.eu" = { + extraDomainNames = [ "*.stats.alanpearce.eu" ]; + }; }; users.groups.acme.members = [ "caddy" @@ -729,6 +744,17 @@ in reverse_proxy ${srv.settings.bindHTTP} ''; }; + "stats.alanpearce.eu" = + let + srv = config.services.goatcounter; + in + { + useACMEHost = "stats.alanpearce.eu"; + serverAliases = [ "*.stats.alanpearce.eu" ]; + extraConfig = '' + reverse_proxy ${srv.listenAddress}:${toString srv.port} + ''; + }; }; }; systemd.services.caddy.serviceConfig = { |