infrastructure/machines/web01/static/default.nix
Tom Hubrecht 95fd21c378
All checks were successful
build configuration / build_vault01 (push) Successful in 51s
build configuration / build_storage01 (push) Successful in 52s
build configuration / build_web02 (push) Successful in 1m0s
build configuration / build_web01 (push) Successful in 1m9s
build configuration / build_compute01 (push) Successful in 1m14s
ds-fr update / npins_update (push) Successful in 1m50s
npins update / npins_update (push) Successful in 1m8s
feat(static): Refactor www-eleves config
2024-01-25 17:19:16 +01:00

21 lines
422 B
Nix

{ lib, ... }:
let
inherit (lib) recursiveUpdate;
websites = import ./npins;
mkVhost =
name:
{ 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";
};
}