infrastructure/hosts/cesium/services/nginx/n7/projet-fin-etude.nix
Laureηt a913961060
🎨 (cesium) dry-ify a little bit the nginx n7 sites
Could be even more dry if got rid of the fetchgit precompiled pages
2024-10-06 18:55:25 +02:00

34 lines
816 B
Nix

{
pkgs,
vhost,
location,
...
}: let
pages = pkgs.fetchgit {
url = "https://git.fainsin.bzh/ENSEEIHT/projet-fin-etude-rapport";
rev = "32fe5c7ec6d67241951fdaf001e3da1c41b29dcf"; # pages
sha256 = "sha256-pOu0lohJ1Yqg/a5hqnNTePTrU8t5By5AbhUAJfL5MBg=";
};
in {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = "${pages}/";
index = "index.html";
tryFiles = "$uri $uri/ /${location}/index.html";
};
services.gatus.settings.endpoints = [
{
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"
"[RESPONSE_TIME] < 300"
"[BODY] == pat(*slidevjs/slidev*)"
"[BODY] == pat(*/${location}/assets/index*)"
];
}
];
}