Dynamics config try

perseverance
Lewis7Lewis 2026-11-12 01:00:32 +01:00
parent 92af32455b
commit 278496d9ea
1 changed files with 20 additions and 0 deletions

View File

@ -74,4 +74,24 @@ in
}; };
}; };
# Override the systemd service to watch a directory instead of the single /nix/store file
systemd.services.gatus = {
environment = {
GATUS_CONFIG_PATH = "/var/lib/gatus/config";
};
serviceConfig = {
StateDirectory = "gatus";
ExecStartPre = let
generatedConfig = (pkgs.formats.yaml { }).generate "gatus-base.yaml" config.services.gatus.settings;
in pkgs.writeShellScript "gatus-setup-config" ''
mkdir -p /var/lib/gatus/config
ln -sf ${generatedConfig} /var/lib/gatus/config/00-base.yaml
echo "announcements:
- timestamp: "2026-11-12T01:00:00Z"
type: outage
message: "Investigating elevated latency on EU servers."
archived: false" >> /var/lib/gatus/config/99-announcements.yaml
'';
};
};
} }