infrastructure/machines/web01/static/default.nix
Tom Hubrecht dbbe739e7c
All checks were successful
lint / check (push) Successful in 30s
build configuration / build_vault01 (push) Successful in 56s
build configuration / build_web02 (push) Successful in 58s
build configuration / build_storage01 (push) Successful in 1m0s
build configuration / build_compute01 (push) Successful in 1m5s
build configuration / build_web01 (push) Successful in 2m26s
feat(web01): Deploy simiweb as a static website
2024-02-06 20:43:46 +01:00

32 lines
589 B
Nix

{
lib,
pkgs,
sources,
...
}:
let
inherit (lib) recursiveUpdate;
websites = import ./npins;
mkVhost =
_:
{ outPath, ... }:
{
enableACME = true;
forceSSL = true;
root = "${outPath}/www";
};
in
{
services.nginx.virtualHosts = recursiveUpdate (builtins.mapAttrs mkVhost websites) {
"eleves.dgnum.eu".locations."/".tryFiles = "$uri $uri/index.html /fr/$uri /en/$uri /fr/index.html";
"simi.normalesup.eu" = {
enableACME = true;
forceSSL = true;
root = (import sources.simiweb { inherit pkgs; }).site;
};
};
}