nixos-config/modules/services/goaccess.nix

36 lines
910 B
Nix
Raw Normal View History

2025-10-05 08:20:57 +02:00
{pkgs, ...}: {
2025-09-24 23:33:06 +02:00
environment.systemPackages = with pkgs; [
goaccess
];
2025-10-05 08:20:57 +02:00
# Service pour générer le rapport statique GoAccess
2025-09-24 23:33:06 +02:00
systemd.services.goaccess-report = {
description = "Generate GoAccess HTML report";
serviceConfig = {
ExecStart = "${pkgs.goaccess}/bin/goaccess /var/log/caddy/access-levr.porzh.me.log --log-format=CADDY -o /var/www/goaccess/index.html";
};
};
2025-10-05 08:20:57 +02:00
# Timer pour régénérer le rapport toutes les heures
2025-09-24 23:33:06 +02:00
systemd.timers.goaccess-report = {
description = "Hourly GoAccess report generation";
2025-10-05 08:20:57 +02:00
wantedBy = ["timers.target"];
2025-09-24 23:33:06 +02:00
timerConfig = {
OnCalendar = "hourly";
Persistent = true;
};
};
services.caddy = {
virtualHosts = {
"koum.porzh.me" = {
extraConfig = ''
root * /var/www/goaccess
file_server browse
try_files {path} {path}/ /index.html
2025-10-05 08:20:57 +02:00
'';
2025-09-24 23:33:06 +02:00
};
};
};
2025-10-05 08:20:57 +02:00
}