{ pkgs, ... }: { systemd.services.docker-health-to-gotify = { description = "Alert Gotify when Docker containers become unhealthy"; after = [ "docker.service" ]; serviceConfig = { Type = "oneshot"; # Run as root so it can read /etc/secrets and access docker socket # User = "root"; #EnvironmentFile = "-/etc/secrets/docker-health-alert.env"; ExecStart = "${pkgs.bash}/bin/bash /home/nixos/docker/monitoring/gotify/docker-health-to-gotify.sh"; StandardOutput = "journal"; StandardError = "journal"; }; path = with pkgs; [ docker curl coreutils gnused ]; }; systemd.timers.docker-health-to-gotify = { wantedBy = [ "timers.target" ]; timerConfig = { OnBootSec = "2min"; OnUnitActiveSec = "1min"; AccuracySec = "15s"; Persistent = true; }; }; }