Add goatcounter.

This commit is contained in:
Lorenzo Good 2025-07-14 00:40:10 -05:00
parent 407928712c
commit f164449faf
Signed by: lorenzo
GPG key ID: 7FCD64BD81180ED0
4 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,45 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf mkOption;
cfg = config.foehammer.services.goatcounter;
in {
options.foehammer.services.goatcounter = {
enable = mkEnableOption "Enable goatcounter server";
port = mkOption {
type = lib.types.port;
default = 8223;
description = ''
What external port to serve over.
'';
};
};
config = mkIf cfg.enable {
users.users.goatcounter = {
isSystemUser = true;
createHome = true;
group = "goatcounter";
};
users.groups.goatcounter = {};
systemd.services.goatcounter = {
serviceConfig = {
User = "goatcounter";
DynamicUser = lib.mkForce false;
};
};
services.goatcounter = {
enable = true;
proxy = true;
address = "0.0.0.0";
port = cfg.port;
};
};
}

View file

@ -10,6 +10,10 @@
hashedPasswordFile = config.sops.secrets.admin-password.path; hashedPasswordFile = config.sops.secrets.admin-password.path;
}; };
services.goatcounter = {
enable = true;
};
services.vaultwarden = { services.vaultwarden = {
enable = true; enable = true;
domain = "https://passwords.foehammer.me"; domain = "https://passwords.foehammer.me";

View file

@ -13,6 +13,11 @@
reverse_proxy :${toString config.foehammer.services.authelia.port} reverse_proxy :${toString config.foehammer.services.authelia.port}
''; '';
}; };
"goatcounter.foehammer.me" = {
extraConfig = ''
reverse_proxy :${toString config.foehammer.services.goatcounter.port}
'';
};
}; };
}; };
} }

View file

@ -5,6 +5,7 @@
directories = [ directories = [
"/var/cache/restic-backups-s3" "/var/cache/restic-backups-s3"
"/var/lib/tailscale" "/var/lib/tailscale"
"/var/lib/goatcounter"
"/var/log" "/var/log"
"/var/lib/nixos" "/var/lib/nixos"
"/var/lib/docker" "/var/lib/docker"